Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Some goals have conversion rate more than 100% #1975

Closed
mattab opened this Issue · 2 comments

2 participants

Matthieu Aubry Stefan Giehl
Matthieu Aubry
Owner

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

Stefan Giehl
Collaborator

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?

Matthieu Aubry
Owner

(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 #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
Matthieu Aubry mattab added this to the 1.5 - Piwik 1.5 milestone
Matthieu Aubry mattab self-assigned this
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.