Skip to content
Advertisement

How to fetch Enhanced ecommerce data from analytics using Google analytics Reporting API – PHP

I configured google analytics and integrated Enhanced ecommerce report of my website. (Screenshot – Analytics Dashboard)

Now I want to fetch the analytics reports via API. I could successfully fetch the reports in “Audience Overview”. But I couldn’t fetch the reports in “Ecommerce Shopping Behavior”.

I used Hello Analytics Reporting API v4 PHP and Dimensions & Metrics Explorer for fetching data.

I want to fetch “Sessions with Add to Cart” and “Sessions with Transactions(Screenshot). But I don’t know which metrics are using for these data.

Does any one know how can we fetch the data in “Ecommerce Shopping Behavior” with analytics reporting API?

Thanks

Advertisement

Answer

For fetching ‘Enhanced Ecommerce – Shopping Behavior’ data, you can use “Shopping Stage” Dimension.

It will provide the informations in Various stages of the shopping experience like PRODUCT_VIEW, ADD_TO_CART, CHECKOUT etc.

So in your case, you want results based on sessions. So try Dimension as “ga:shoppingStage” and Metrics as “ga:sessions

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement