• Resolved baksteendegeweldige

    (@baksteendegeweldige)


    I enabled the Google Analytics option in Complianz, so Complianz puts Google Analytics on my site.
    I filled in the tracking ID (UA-……), I filled in the conversion ID (AW-….) (all via the Complianz wizard)

    But now I need to add the event fragment (To record a Google ads conversion)
    (<script>
    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-……………….’,
    ‘value’: 1.0,
    ‘currency’: ‘EUR’
    });
    </script>)

    I used an additional plugin “Header Footer Code Manager”, to put this code in the header of the page I want to trigger the conversion for.

    But If I visit that page, I get the error (in my console):

    “Uncaught ReferenceError: gtag is not defined”

    How should I add the event fragment for Google ads if I configured Complianz this way?`

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hi @baksteendegeweldige,

    You can configure Complianz not to place the script on your site, then follow the steps in this article, which explains how you can adjust the gtag.js script to fire the tags on separate consent levels: https://complianz.io/adding-global-site-tag-gtag-js-with-granular-consent/

    For each part of the Global site tag, you can adjust on which consent type/level these should be loaded. I have attached the lines you can use to modify your current script to do so, but the article mentioned earlier goes into further detail:

    <!-- Consent Levels - Complianz -->
    // Functional
    <script type="text/javascript" data-category="functional"></script>
    // Preferences
    <script type="text/javascript" data-category="preferences"></script>
    // Statistics
    <script type="text/plain" data-category="statistics"></script>
    // Marketing
    <script type="text/plain" data-category="marketing"></script>

    Hope it helps, just let me know if we can assist.

    Kind regards,
    Jarno

    Thread Starter baksteendegeweldige

    (@baksteendegeweldige)

    Thanks, it worked!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Installing Google ads conversion tag with Complianz’ is closed to new replies.