0
votes

I have set up the Google analytics API on Google sheets for reporting purposes, however have had some issues in capturing transaction and revenue data, when filtering.

The API pulls in revenue and transaction data fine for me when not filtering, however I've used the below filter, because this is how our website splits out our white labels, with each white label having a different affiliate id.

ga:pagePath=@/?affiliate_id=default

This pulls through the filtered session data through fine, but does not pull through transaction or revenue data.

When using Google Analytics rather than the GA API in Google sheets, the same filter works fine, and shows the transaction and Revenue data. However through the API in Google Sheets the above filter shows the transactions and revenue as 0.

Does anybody know what I've done wrong here, and what the correct code would be to enter in the filter box in Google sheets so I can pull in the transaction and revenue data?

My technical knowledge is very limited here so appreciate the help.

Many thanks!

Rob

1

1 Answers

0
votes

You may want to try the queries given in Core Reporting API - Common Queries.

Like, for Revenue Generating Campaigns, to get campaign and site usage data for campaigns that led to more than one purchase through your site, you may use this query:

dimensions=ga:source,ga:medium
metrics=ga:sessions,ga:pageviews,ga:sessionDuration,ga:bounces
segment=dynamic::ga:transactions>1

And to get information on revenue generated through the site for the given time span, sorted by sessions in descending order, you may use the sample query in All Traffic Sources - E-Commerce:

dimensions=ga:source,ga:medium
metrics=ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases
sort=-ga:sessions

I also suggest that you try and explore using Query Explorer.