Client has a website on Squarespace, with google analytics tracking.

They are using shopify for order processing. I think this is called the 'buy button sales channel' on shopify. When a user clicks 'BUY' on the squarespace site they are forwarded to the shopify domain https://checkout.shopify.com/...

Shopify -> Settings -> Checkout has a field called 'additional scripts' which seems promising. The help states:

The Additional content & scripts box is used to insert code into the template for your order status page. You can add any of the following:

HTML You can use any valid HTML5 code, for example script, style, iframe and object elements.

Liquid code You have access to the checkout and shop liquid objects.

ROI/conversion tracking scripts

Referral tracking scripts

So I added a test script to that field:

<script language="javascript" type="text/javascript"> console.log('test'); </script>

But I don't see any console message. Perhaps this only works on the 'order status page'?

As you noted, the Shopify -> Settings -> Checkout field called 'additional scripts' will only load on the actual status page after checkout is complete.

In order to add your Buy Button event tracking in Shopify, you want to add your scripts to the Checkout > Order Processing section. Refer to https://ecommerce.shopify.com/c/ecommerce-marketing/t/using-a-custom-google-analytics-code-with-buy-button-426022

Otherwise, using Google Tag Manager, you can more readily setup the event tracking for future marketing campaign metrics.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.