Can I integrate Google Analytics with Shopify checkout via API?

Can I integrate Google Analytics with Shopify checkout via API?

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 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.



Replies 2 (2)

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 and

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!