Google Tag Manager Installation
If you use Google Tag Manager (GTM), you can install TrueTracked without editing your website's source code. Add the tracking script as a Custom HTML tag, trigger it on every page, and use additional tags for ecommerce events sourced from your existing dataLayer.
Prerequisites: Your TrueTracked workspace ID (under Settings > Pixel Installation) and admin access to your GTM container.
Step 1: Create the base loader tag
- In GTM, click Tags > New
- Name it TrueTracked - Base Loader
- Choose tag type Custom HTML
- Paste the base loader script:
<link rel="preconnect" href="https://t.ttrkd.com">
<link rel="preconnect" href="https://t.ttrkd.com" crossorigin>
<script>
(function(w, d, id) {
var t = w.truetracked = w.truetracked || function() {
(t.q = t.q || []).push(arguments);
};
t._w = id;
var s = d.createElement('script');
s.async = true;
s.src = 'https://t.ttrkd.com/tt.js?w=' + id;
d.head.appendChild(s);
})(window, document, 'YOUR_WORKSPACE_ID');
</script>- Set the trigger to All Pages (built-in
Page Viewtrigger) - Click Save
Step 2: Track ecommerce events from dataLayer
Create additional Custom HTML tags for each event you want to track. Use GTM data-layer variables to pull the values dynamically. Example for a purchase event triggered on the order confirmation page:
<script>
window.truetracked('track', 'purchase', {
transaction_id: '{{dlv - ecommerce.transaction_id}}',
value: {{cjs - ecommerce.value (number)}},
currency: '{{dlv - ecommerce.currency}}',
email: '{{dlv - user_data.email}}',
phone: '{{dlv - user_data.phone}}',
first_name: '{{dlv - user_data.first_name}}',
last_name: '{{dlv - user_data.last_name}}',
items: {{cjs - ecommerce.items-TT}}
});
</script>For the full purchase event field reference (required vs recommended vs optional), see Custom Website.
Step 3: Preview and publish
- Click Preview in GTM
- Enter your site URL and click Connect
- In your browser, perform a test action (e.g. complete a test order)
- In the GTM debugger, verify the TrueTracked tag fired
- Open browser DevTools → Network tab → filter
ttrkd- you should seePOST /eventrequests - Click Submit in GTM to publish the container
Tips for Shopify + GTM
If your Shopify store is wired to GTM via Web Pixels or a data-layer extension (like Elevar), use GTM data-layer variables to pull from ecommerce.products, ecommerce.purchase, etc. The standard Enhanced Ecommerce schema works out of the box.
Custom tracking domain
With a custom tracking domain set up, swap the script src from t.ttrkd.com to your subdomain.
Troubleshooting
- Tag not firing: In GTM Preview mode, check the "Tags Not Fired" section - usually a trigger mismatch.
- Data-layer variables resolve to empty: Use GTM's built-in dataLayer panel during preview to confirm the variable path matches your site's actual data layer shape.
- Container not published: Preview mode reflects your draft; live visitors only see published changes. Click Submit in GTM after testing.