Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some goals have conversion rate more than 100% #1975

Closed
mattab opened this issue Jan 7, 2011 · 2 comments
Closed

Some goals have conversion rate more than 100% #1975

mattab opened this issue Jan 7, 2011 · 2 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Jan 7, 2011

Edit 2020: If you still experience this issue please leave a comment with a screenshot and some information.

Is this expected? if yes, create FAQ to explain why. If not, this is a bug to fix.

see http://forum.piwik.org/read.php?2,70802

@sgiehl
Copy link
Member

sgiehl commented Mar 19, 2011

I would suppose that is a bug. Checking the code I found this in plugins/Goals/Controller.php:

private function getConversionRateReturningVisitors( $idSite, $period, $date, $idGoal = false )
{
    // visits converted for returning for all goals = call Frequency API
    if($idGoal === false)
    {
        $request = new Piwik_API_Request("method=VisitFrequency.getConvertedVisitsReturning&idSite=$idSite&period=$period&date=$date&format=original");
        $nbVisitsConvertedReturningVisitors = $request->process();
    }
    // visits converted for returning = nb conversion for this goal
    else
    {
        $nbVisitsConvertedReturningVisitors = Piwik_Goals_API::getInstance()->getConversions($idSite, $period, $date, $segment=false,$idGoal);
    }
    // all returning visits
    $request = new Piwik_API_Request("method=VisitFrequency.getVisitsReturning&idSite=$idSite&period=$period&date=$date&format=original");
    $nbVisitsReturning = $request->process();

    return Piwik::getPercentageSafe($nbVisitsConvertedReturningVisitors, $nbVisitsReturning, Piwik_Goals::ROUNDING_PRECISION);
}

If I seen that right, if a goalid is given, the plugin uses the overall conversion rate for calculating the rate for returning visitors?

@mattab
Copy link
Member Author

mattab commented May 16, 2011

(In [4691]) Refs #898 Work in progress (but should leave trunk stable and not break anything)

  • Now tracking Ecommerce Items (sku,name,category,qty,price)

  • zero, 1 or many items can be in a Ecommerce Cart (total), or an Ecommerce order (orderid, grandtotal, subtotal, tax, shipping, discount)

  • A Cart left at the end of a visit becomes an Abandoned cart. New reports separate orders from abandoned carts.

  • JS API and PHP API have 3 new functions (add items, track cart update, track ecommerce order)

  • JS stores timestamp last ecommerce transaction in id cookie so we can count repeat buyers

  • Goals.get API now returns stats for the two goals: ecommerceOrder and ecommerceAbandonedCart

  • new API functions to request Items (product) reports: getItemsSku, getItemsName, getItemsCategory. See doc:

    If you are tracking Ecommerce orders and products on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory"
    will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category. For each name, SKU or category, the following
    metrics are returned: Total revenue, quantity, average price, average quantity, number of orders with this product.

    By default, these functions returns the 'Products purchased'. These functions also accept an optional parameter &abandonedCarts=1.
    If the parameter is set, it will instead return the metrics for products that were left in an abandoned cart therefore not purchased.

    The API also lets you request overall Goal metrics via the method "get": Conversions, Visits with at least one conversion, Conversion rate and Revenue.
    If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart)
    or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered)

  • showing ecommerce orders/abandoned carts in the Live! API output

  • new segments: visitEcommerceStatus and daysSinceLastEcommerceOrder

  • these new attributes also appears in Live! API output

  • Fixes Some goals have conversion rate more than 100% #1975 as side effect of cleaning up all this code this bug should now be fixed (bug was to use nb of conversions as dividend, rather than number of converted visits)

  • adding full integration test testing all possible use cases regarding Ecommerce carts/orders/items etc.

  • also integration testing the changes to piwik.js

@mattab mattab added this to the 1.5 - Piwik 1.5 milestone Jul 8, 2014
@mattab mattab self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants