Support Forum Support Forum GDPR Cookie Compliance The plugin not loading the infobar, and my custom script in the Woocommerce than

Topic Resolution: Resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Avatarmow187
    January 17, 2020 @ 12:07 pm

    Hi! The GDPR infobar not working, and my custom script are not loaded after i buy something with Woocemmerce, and i’m in the Thank you page. I would like to write a plugin, that send orders data to the Google Analytics, but it show’s a console error with “gtag is not defined”. In any other page, the gtag is loaded and defined, only in the thank you page won’t work!
    Thank’s for the help!

    Moove AgencyMoove Agency
    January 22, 2020 @ 7:54 am

    Hi mow187,

    Thanks for your comments.

    If your Google Analytics tracking script is added by GDPR plugin and the user disabled the cookies, the gtag will not be injected to your page.

    To fix the issue, you have the following options:
    1. You can disable the GDPR Cookie Compliance plugin on your “Thank you” page (feature available in premium add-on), and you can add the Google Analytics tracking script manually to Thank you page.
    2. You can find the relevant hooks & functions in our plugin Help section allowing you to check if the GDPR cookies are accepted by user, and send the order data only if cookies are accepted.
    3. Alternatively, you can check in JavaScript if the gtag is loaded (if the user accepts the cookies, will be loaded):
    if (typeof gtag !== “undefined”) {
    console.warn(‘Google Analytics loaded, you can send your order data’);
    }

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘The plugin not loading the infobar, and my custom script in the Woocommerce than’ is closed to new replies.