Search code examples
google-analyticsgoogle-analytics-api

google analytics api - mcf api - assistedConversions - How to get only e-commerce conversions?


Hello Analytics API users!

Is there a Way to get or to filter the totals to get only one type of conversions - e-commerce conversions?

Example from the docs:

mcf:assistedConversions

The number of conversions for which this channel appeared on the conversion path, but was not the final conversion interaction. This metric includes both goal completions and transactions.

All the metrics have both conversion types. Is there a way to get only e-commerce totals? How you deal with this problem?


Solution

  • Yes, it is possible to narrow down your API report to eCommerce transactions.

    You need to set up a filter for mcd:converionType to equal Transaction.

    An example in PHP would look like this:

    $optParams = array('dimensions' => 'mcf:medium',
                       'filters' => 'mcf:conversionType%3D%3DTransaction');
    
    $ga_result = $analytics->data_mcf->get('ga:'.$profileID,
                                           '2016-08-01',
                                           '2016-08-31,
                                           'mcf:assistedConversions,mcf:lastInteractionConversions',
                                           $optParams);
    

    Further details are available here.