CDPGuidesSupport
Examples

Tag Manager Recipes

Copyable Ours Privacy Tag Manager setups: CTA clicks with properties, form submissions, purchases from the data layer, consent-gated tags, and path grouping.

Each recipe below is a complete tag, trigger, and variable setup for one goal. Build it in a draft, confirm it in Preview mode, then publish.


Track a CTA click with its text and destination

  • Trigger: All Links Click, condition Click Element Classes contains cta.
  • Tag: Track, Event Name CTA Clicked, properties cta_text = {{Click Text}} and destination = {{Click Element URL}}.
The tag drawer for a Track tag named CTA clicked, with the event name CTA Clicked, event properties cta_text and destination set to the Click Text and Click Element URL variables, and the CTA link click trigger of type All Links Click under Firing Triggers.

Track a form submission

  • Trigger: Form Submit, condition Form Element ID equals contact-form.
  • Tag: Track, Event Name Form Submitted, property form_name = {{Form Element ID}}.

If the form sends its data in the background and never submits in the browser, push a custom event from your code once the request succeeds and use a Custom Event trigger instead:

fetch('/api/contact', { method: 'POST', body }).then(() =>
  window.dataLayer.push({ event: 'contact_form_success' })
);

Track a purchase from the data layer

Your checkout pushes the order:

window.dataLayer.push({ event: 'purchase', value: 149.99, currency: 'USD' });
  • Variables: Data Layer Order Value reading value, Data Layer Currency reading currency.
  • Trigger: Custom Event, Event Name purchase.
  • Tag: Track, Event Name Purchase, properties value = {{Order Value}} and currency = {{Currency}}.

  • Variable: Consent: Category, category marketing, named Marketing Consent.
  • Trigger: Page View, condition {{Marketing Consent}} equals true.
  • Tag: Custom HTML containing the pixel snippet, with that trigger.

Add a second Consent: Change trigger to the same tag so it also fires when a visitor accepts marketing after the page has loaded.


Group pages into a reporting label

  • Variable: RegEx Table named Service Line, input {{Page Path}}, rows ^/cardiology to cardiology, ^/dermatology to dermatology, fallback other.
  • Tag: Update Default Event Properties, property service_line = {{Service Line}}, fired by Page View.

Every later event on the page carries service_line without touching each tag.


Next steps

How is this guide?

On this page