Cookies

Re-tagging common trackers: before and after examples

Contents
  1. Google Tag Manager: marketing, with two locks
  2. Google Analytics 4: analytics
  3. Google Ads: marketing
  4. Meta pixel: marketing
  5. Microsoft Clarity: analytics
  6. Microsoft Advertising (UET): marketing
  7. TikTok pixel: marketing
  8. LinkedIn Insight Tag: marketing
  9. Hotjar: analytics
  10. VWO (now Wingify): analytics
  11. Funnelytics: analytics
  12. Wicked Reports: marketing
  13. OptinMonster: marketing
  14. Deadline Funnel: functional, not marketing
  15. A tool not listed here

This page gives a before and after example for each tracker the Trust Center scan most often finds running before consent. Each one uses the same change, explained in Make your trackers wait for consent: add type="text/plain" and data-tc-consent with the right category to every script of the tag, and leave everything else exactly as the vendor gave it to you. Your Trust Center fix list already has your own tags re-tagged with your account numbers; use these examples to understand them or to re-tag a tag the scan has not seen yet.

In the examples, … stands for the vendor's own code, which you keep unchanged. Account numbers such as G-XXXXXXX are placeholders.

Google Tag Manager: marketing, with two locks

Tag Manager loads other tags, so it needs two locks.

Lock 1: the container. Re-tag the Tag Manager script. Use marketing whenever the container holds any advertising tag (Google Ads, Meta, Microsoft, TikTok, LinkedIn). Only if it holds analytics tools and nothing else is analytics enough.

<!-- Before -->
<script>(function(w,d,s,l,i){…})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">(function(w,d,s,l,i){…})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>

The <noscript> part of the Tag Manager code only works when a browser has scripts switched off. It does not need changing, and you can delete it.

Lock 2: each tag inside. Once the container runs, every tag in it runs too, unless you tell it to check consent. Google's own tags read Consent Mode by themselves. For every other tag, in Tag Manager open the tag, then Advanced settings, Consent settings, choose Require additional consent for tag to fire, and add ad_storage for advertising pixels or analytics_storage for analytics tools. Google explains these settings in its consent mode guide for Tag Manager. The second lock matters because a visitor can accept Performance and refuse Marketing: the container then runs, and only the consent checks keep the ad pixels in it from firing.

If you want Google Analytics for visitors who accept Performance but not Marketing, take the GA4 tag out of the container and paste it directly, as in the next section. The full Google setup, including URL passthrough and enhanced conversions, is in Setting up Google Analytics, Google Ads and Tag Manager with consent.

Google Analytics 4: analytics

The Google tag comes in two parts. Re-tag both.

<!-- Before -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="analytics" async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script type="text/plain" data-tc-consent="analytics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>

Google Analytics sets the cookies _ga and _ga_ followed by your container ID (Google's cookie list). Holding the tag until consent is what Google calls basic consent mode: no Google tag loads until the visitor chooses (Google's consent mode overview).

A Google Ads tag uses the same Google tag with an AW- number. If GA4 and Google Ads share one Google tag, re-tag it as marketing, or split them so GA4 can run for visitors who accept Performance only.

<!-- Before -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-XXXXXXXXX"></script>
<script>
  …
  gtag('config', 'AW-XXXXXXXXX');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing" async src="https://www.googletagmanager.com/gtag/js?id=AW-XXXXXXXXX"></script>
<script type="text/plain" data-tc-consent="marketing">
  …
  gtag('config', 'AW-XXXXXXXXX');
</script>

Protect your ad measurement at the same time: keep the Trust Center line first so Consent Mode is set before any Google tag, turn on URL passthrough, and check the consent diagnostics in Google Ads. The steps are in the Google consent setup guide. Google describes how Consent Mode affects Ads measurement in About consent mode.

Meta pixel: marketing

<!-- Before -->
<script>
  !function(f,b,e,v,n,t,s){…}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', 'XXXXXXXXXXXXXXX');
  fbq('track', 'PageView');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">
  !function(f,b,e,v,n,t,s){…}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', 'XXXXXXXXXXXXXXX');
  fbq('track', 'PageView');
</script>

The pixel sets _fbp, and _fbc after an ad click. Meta's pixel consent guide describes its own consent commands; with the tag held by Trust Center you do not need them. If your pixel is connected through Kajabi's built-in Facebook pixel setting instead of a pasted tag, it cannot be held: clear that setting and paste the tag, re-tagged. Event code on other pages, such as fbq('track', 'Lead') on a thank-you page, needs the same change.

Microsoft Clarity: analytics

<!-- Before -->
<script type="text/javascript">
  (function(c,l,a,r,i,t,y){… t.src="https://www.clarity.ms/tag/"+i; …})(window, document, "clarity", "script", "xxxxxxxxxx");
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="analytics">
  (function(c,l,a,r,i,t,y){… t.src="https://www.clarity.ms/tag/"+i; …})(window, document, "clarity", "script", "xxxxxxxxxx");
</script>

Remove the old type="text/javascript": a tag can only have one type. Clarity sets _clck and _clsk on your site (Microsoft's Clarity cookie list). Microsoft has required a consent signal for visitors from the EEA, the UK and Switzerland since 31 October 2025; its Clarity consent API page explains the options. A held tag only runs after consent. If Clarity is loaded by Google Tag Manager, give its tag the analytics_storage consent check described under Tag Manager.

Microsoft Advertising (UET): marketing

<!-- Before -->
<script>(function(w,d,t,r,u){…})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">(function(w,d,t,r,u){…})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>

The UET tag sets _uetsid and _uetvid. Microsoft's UET guide covers installing the tag on every page.

TikTok pixel: marketing

<!-- Before -->
<script>
  !function (w, d, t) {… ttq.load('XXXXXXXXXXXXXXXXXXXX'); ttq.page(); }(window, document, 'ttq');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">
  !function (w, d, t) {… ttq.load('XXXXXXXXXXXXXXXXXXXX'); ttq.page(); }(window, document, 'ttq');
</script>

The pixel sets _ttp. It can also set ttcsid_ cookies. TikTok's help centre explains how the pixel uses cookies.

LinkedIn Insight Tag: marketing

The Insight Tag has two scripts. Re-tag both.

<!-- Before -->
<script type="text/javascript">
  _linkedin_partner_id = "XXXXXXX";
  …
</script>
<script type="text/javascript">
  (function(l) {… b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; …})(window.lintrk);
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">
  _linkedin_partner_id = "XXXXXXX";
  …
</script>
<script type="text/plain" data-tc-consent="marketing">
  (function(l) {… b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; …})(window.lintrk);
</script>

LinkedIn's guide to adding the Insight Tag also asks you not to place it on pages that collect sensitive health or financial information.

Hotjar: analytics

<!-- Before -->
<script>
  (function(h,o,t,j,a,r){ h._hjSettings={hjid:XXXXXXX,hjsv:6}; … })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="analytics">
  (function(h,o,t,j,a,r){ h._hjSettings={hjid:XXXXXXX,hjsv:6}; … })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>

Hotjar's cookies start with _hj. Hotjar lists them, and says they can be held until the visitor consents, in Cookies set by the Hotjar tracking code. If you use Hotjar surveys or feedback widgets that collect answers, mention them in your privacy policy.

VWO (now Wingify): analytics

<!-- Before -->
<script type='text/javascript' id='vwoCode'>
  window._vwo_code || (function() { var account_id=XXXXXX, … })();
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="analytics" id='vwoCode'>
  window._vwo_code || (function() { var account_id=XXXXXX, … })();
</script>

Keep the id='vwoCode'. VWO's code briefly hides the page while a test loads, so that visitors do not see the original version flash first (VWO's SmartCode settings). Once held for consent the page shows straight away, and tests start after the visitor accepts Performance. Visitors who refuse see your original page, which is the right result. VWO's cookies start with _vwo and _vis_opt, or _wingify for accounts opened from June 2026. VWO also has its own consent setting, described in Configuring SmartCode for cookie consent; the held tag does the same job, so you do not need both.

Funnelytics: analytics

<!-- Before -->
<script type="text/javascript">
  (function(funnel) { … window.funnelytics = … })('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="analytics">
  (function(funnel) { … window.funnelytics = … })('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
</script>

Funnelytics measures how visitors move through your funnel on your own pages, so analytics fits. If you use it to send data to ad platforms, use marketing instead.

Wicked Reports: marketing

<!-- Before -->
<script type="text/javascript" src="https://widget.wickedreports.com/v2/XXXX/wr-XXXXXXXX.js" async></script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing" src="https://widget.wickedreports.com/v2/XXXX/wr-XXXXXXXX.js" async></script>

Wicked Reports ties sales back to the ads that brought each visitor. Its standard script stores the visitor's campaign details in a cookie (Wicked Reports tracking help). That is advertising attribution, so it is marketing.

OptinMonster: marketing

<!-- Before -->
<script>(function(d,u,ac){… s.src='https://a.omappapi.com/app/js/api.min.js'; …})(document,XXXXXX,XXXXXX);</script>

<!-- After -->
<script type="text/plain" data-tc-consent="marketing">(function(d,u,ac){… s.src='https://a.omappapi.com/app/js/api.min.js'; …})(document,XXXXXX,XXXXXX);</script>

OptinMonster shows popups and remembers who has seen them with first-party cookies such as _omappvp and _omappvs (OptinMonster's cookie list). OptinMonster's guide to consent tools confirms its popups may not show to visitors who reject cookies. Held for consent, your popups show to visitors who accept Marketing. In places where tracking starts on (most of the United States, Australia, Canada outside Quebec) that is nearly everyone; in Europe and the UK it is only visitors who accept.

Deadline Funnel: functional, not marketing

<!-- Before -->
<script data-cfasync="false" type="text/javascript">
  function SendUrlToDeadlineFunnel(e){…}
  … "https://a.deadlinefunnel.com/unique-js/XXXXXX" …
</script>

<!-- After -->
<script type="text/plain" data-tc-consent="functional" data-cfasync="false">
  function SendUrlToDeadlineFunnel(e){…}
  … "https://a.deadlinefunnel.com/unique-js/XXXXXX" …
</script>

Deadline Funnel runs the countdown on your offer: it recognises each visitor, by default with a cookie and their IP address, so the deadline stays the same on every visit (how Deadline Funnel tracks leads). That makes it part of the offer the visitor is looking at, so Trust Center holds it as functional. Deadline Funnel's own cookie list labels its df- cookie as marketing; we choose functional because the countdown is a feature of the page, and your cookie policy lists the cookie either way. Do not hold it for marketing. Visitors who switch Marketing off, browsers that send Global Privacy Control, and, for health and wellbeing businesses, every visitor until they accept Marketing, would then see a broken countdown or miss the offer. Deadline Funnel code is often pasted twice, once in the site header and once on a page. Keep one copy.

A tool not listed here

Use the same change. Choose marketing unless you are sure the tool only measures visits on your own site (analytics) or is a feature the visitor uses on the page (functional). The Trust Center scan marks a tracker it does not know as marketing with "category to confirm", so you can tell us if it should be something else.

See what your own website shows

The free scan checks your site for cookies set before consent, missing policies and basic security settings, and gives you a score in under a minute.

Run the free scan →