2. Add pixel (Tracking script)
Learn how to install the Dema tracking script on various platforms like Shopify, custom sites, and Google Tag Manager. Verify your events are coming in and troubleshoot common issues.
Adding the Dema Pixel
Dema’s tracking pixel ensures that your site captures all key events (page views, product views, and orders) accurately and in near real-time. Follow the steps below to implement it based on your platform.
Where is the script implemented?
Dema offers multiple methods to deploy tracking, depending on your platform:
-
Shopify: Dema’s web pixel leverages Shopify’s Web Pixel API to automatically capture key events. No manual code injection is needed once you install the Dema app.
Learn how to set up tracking on Shopify -
Google Tag Manager (GTM): Insert the Dema tracking script as a custom HTML tag in your GTM container. Use triggers like
pageview
orDOM ready
for standard events.
Learn how to set up tracking using GTM -
Server-side tracking: Send data directly to Dema’s tracking endpoint from your server for maximum reliability and privacy.
Learn how to send data server-side
Single-Page Applications (SPA): For SPAs, ensure events are fired manually on navigation or route changes.
Learn more about SPA tracking.
Verifying events
Once the Dema pixel is implemented, verify that events are being tracked correctly:
-
Use Browser Developer Tools:
- Open the Network tab in your browser’s developer tools.
- Trigger an event (e.g., load a page or view a product).
- Look for requests sent to Dema’s endpoint (
https://tracker.dema.ai
).
-
Check the Dema Dashboard:
- Navigate to the Real-Time Dashboard in Dema.
- Verify that events are appearing shortly after they occur (typically within 3 minutes).
-
Test Different Scenarios:
- Test on multiple devices and browsers to ensure consistent tracking.
- Check campaign attribution by visiting your site with UTM-tagged URLs (e.g.,
utm_source=google
).
Debugging and additional help
For a deeper understanding of how Dema’s tracking works, including detailed troubleshooting guidance, refer to our Fundamentals: Tracking page.
Need help? Visit our Support Center or contact us at support@dema.ai for further assistance.