Prerequisites
- Google Tag Manager account with a container deployed to your website
- Attribution script already deployed on your site
- Access to your GTM workspace to create tags and triggers
What GTM Does in the Pipeline
Step 1: Create CTA View Event Tag
This tag fires when a CTA becomes visible on the page.- In GTM, create a new Custom HTML tag
- Set the trigger to a Custom Event named
cta_view - Add this HTML:
Replace the
{{...}} template variables with actual GTM variables that pull from your CTA data attributes (data-cta-id, data-cta-position, data-asset-content-id).Step 2: Create CTA Click Event Tag
This tag fires when a user clicks a CTA element.- Create a new Custom HTML tag
- Set the trigger to click events on elements with
[data-cta-id]or the.cr-ctaclass - Add this HTML:
Step 3: Create Server-Side Tag (Recommended)
For more reliable event delivery, set up a server-side GTM container:- Create or use an existing server-side GTM container
- Add a tag that forwards
cta_viewandcta_clickevents to: - Include all event parameters in the request payload
Step 4: Test Events
Browser Console Test
- Visit a page with CTAs on your website
- Open browser DevTools → Console
- Type
dataLayerand press Enter - Look for
cta_viewandcta_clickevents in the array - Verify each event has a non-null
attribution_id
GTM Preview Mode
- In GTM, click Preview to enter debug mode
- Visit your website — the GTM debug panel appears
- Interact with CTAs
- Verify your tags fire on the correct triggers
WisePilot Verification
- After generating some events, check the Data Quality Console
- The Freshness section should show recent GTM events
- The Coverage section should show CTA clicks with attribution
Troubleshooting
Events not arriving in WisePilot
- Check GTM container is deployed — View your page source and verify the GTM snippet is present
- Check browser console — Look for JavaScript errors that might prevent tags from firing
- Check network tab — If using server-side, verify requests to
/api/integrations/gtm/eventsare succeeding (200 status) - Check ad blockers — Some ad blockers prevent GTM from loading. Test in an incognito window with extensions disabled.
Events arrive but attribution_id is null
- Verify attribution script loads before GTM — The script must set the cookie before GTM reads it
- Check
window.getAttributionId()— Open the console and call this function. If it returnsnull, the attribution script isn’t running. - Check cookies — Look for
cr_attribin Application → Cookies. If missing, the attribution script may be blocked.
Events arrive but CTA fields are empty
- Verify your CTA elements have the required data attributes:
data-cta-id,data-cta-position,data-asset-content-id - Check that your GTM variables are correctly reading from these attributes
- Test with the GTM Preview panel to see what values the variables resolve to