What's your biggest current challenge? Have your say in Community Polls along the right column.

Can I integrate Google Analytics with Shopify checkout via API?

Can I integrate Google Analytics with Shopify checkout via API?

thepatternlab
Visitor
1 0 0

Hi folks!

I'm integrating my own website with Shopify via Shopify API, and after the user adds item to the cart and click "Go to Checkout", I redirect to Shopify Checkout.

Is there any way to add Google Analytics to that Checkout?

In this page https://help.shopify.com/en/manual/reports-and-analytics/google-analytics/google-analytics-setup they explain how to add Google Analytics to a Shopify webpage, but since I'm only integrating with Shopify at checkout, I wonder if I can do it via Additional scripts or something along those lines.

What I want to get is to track is when the user enter to the Shopify checkout and buys the Cart, would be great if there is any way to send the ecommerce event to Google Analytics.

Thanks!

Martin.

Replies 2 (2)

ruleana
New Member
4 0 0

Hi! You can link two different domains. You should put the same google analytics ID to the both websites.  They will be in the same Resource in GA. If they have different domains, I think you shouldn't cut domain name in the resource settings.
Then in order to not count users on the Checkout as new you should use cookies of your main web site. There are different implementation for analytics.js and  gtag.js. You can link domains using  Linker google plugin.
You can find more info here https://support.google.com/analytics/answer/1034342?hl=en and https://developers.google.com/analytics/devguides/collection/analyticsjs/linker

KevinShop
Visitor
1 0 0

Hi there!

Up until now, I've had the same issue. Here's how I have been able to achieve the checkout page tracking in analytics:

In shopify, go to Online Store -> Preferences. Here you can add the code snippet for Google Analytics.

I'm not sure if that is enough though, since I have done a few extra steps:
Next: add additional java script and paste your Google Tag Manager code. Check the box for "Use enhanced ecommerce" and make sure to save it.

That should do the trick!