How to achieve 100% accurate tracking on Shopify with sGTM and Data Store

Written by

Vlad Kononov

Updated Sep 15, 2026 comments

Skip manual event setup

Step-by-step configuration

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.

Before you begin

  1. 1.
Select your sGTM container from the dashboard
Click Activate Data Store

Step 1. Implement basic tracking setup with the Stape Conversion Tracking app

Step 2. Store necessary cookies in Click Activate Data Store.

analytics.subscribe("checkout_started", (event) => {   setTimeout(() => {     async function getCookiesPayload() {       try {         const payload = {           "event": "store_cookies",           "cart_token": init.data.cart.id,           "fbp": await browser.cookie.get('_fbp'),           "fbc": await browser.cookie.get('_fbc')         };         return payload;       } catch (error) {         console.error('Error retrieving cookies:', error);         return null;       }     }     async function sendCookiesToSgtm() {       const payload = await getCookiesPayload();       if (payload) {         fetch("https://sst.example.com/data", {           method: "POST",           headers: {             "Content-Type": "application/json"           },           body: JSON.stringify(payload),           keepalive: true         }).then(response => {           console.log('Payload sent successfully:', response);         }).catch(error => {           console.error('Error sending payload:', error);         });       }     }     sendCookiesToSgtm();   }, 1500); });
Stape Store Writer tag config

Step 3. Store every purchase reported from the web container in Data Store

Stape Store Writer tag

Step 4. Set up a webhook in Shopify

Set up a webhook in Shopify

Step 5. Verify if the order sent via webhook has already been processed

  1. 1.
  2. 2.
  3. 3.
Stape Store Lookup variable
Stape Store Lookup variable

Conclusion

Want to start on the server side?

Try for free

Written by

Vlad Kononov

Content writer

Vlad, a Tracking & Measurement specialist, excels in GTM and sGTM. He helps businesses ensure accurate data collection, seamless integration, and optimized measurement strategies.

Was this article helpful?

Comments

Recommended for you

Turn better tracking into better marketing performance

Try for free