Elevar will be responsible for adding GTM to all (Shopify based) checkout pages. You are responsible for adding the GTM script to all headless site pages.

To do this you’ll need your web container GTM ID (don’t use a server side container ID here)

Step 1: Install GTM

Paste the following code as high in the <head> tags as possible, making sure to replace GTM-XXXXXX with your web container ID. [How to find Web Container ID?]

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

Step 2: Install the Data Layer on Shopify Checkout Pages

You’ll need to install the Elevar data layer to the Shopify portion of your website from the Elevar app in order to proceed further.

This can be accessed in the Elevar App under the My Tracking → Data Layer section.

[Here’s how to implement the Data Layer with your Shopify Plus Store]

This will also guide you through the installation of Elevar’s Non-Shopify Attribution script on the headless portion of your website.

In the Data Layer setup section, under the “Non-Shopify Attribution Tracking” step. You’ll need to select “Yes” for “Do you have Non-Shopify Subdomain Pages”.

Elevar will attempt to fetch your Shop’s custom domain. If this domain isn’t available, you’ll be prompted to manually enter it. [How do I find this?]

After doing so, you’ll need to copy the highlighted code like below and include it immediately after the opening <head> section of your headless site on all the pages.