Support » Plugin: Enhanced Ecommerce Google Analytics Plugin for WooCommerce » Errors if analytics lib is not loaded

  • We are using this plugin in conjunction with Borlabs Cookie in order stay GDPR compliant. We have an opt-in solution, which ensures, that Google Analytics is only loaded if the user agreed to being tracked.

    However: If the user has not given consent and the google analytics lib is not loaded, your plugin throws an error that gtag function is undefined.

    Would it be possible to safeguard these methods or more in general: That your plugin only runs, if an active Google Analytics integration was found?

    GDPR court decisions move into the direction that opt-in is mandatory for Google Analytics/Tracking so I assume this will affect all European users of the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Destiny35



    Our plugin uses latest GA tracking gtag.js. While activating our plugin did you activate “Enable global site tracking”. If not, enable it and this will solve your concern.

    Also this issue is not because of conflict between any other plugin.

    Hope this helps.


    Sorry, I was not clear enough. This is not what this was about.

    We use a third-party-consent management plugin (Borlabs Cookie) that implements gtag.js

    There are two scenarios:

    (1) User gives consent to being tracked -> gtag.js is loaded
    (2) User gives no consent to being tracked -> gtag.js is NOT loaded

    We use your plugin only for the enhanced ecommerce functionality.

    Problem: Your plugin throws errors if gtag.js is not loaded.
    Suggestion: Your plugin should check if gtag.js is loaded before executing your js

    All current consent/opt-in solutions for GA work the same: They only load gtag.js if the user has agreed to it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Errors if analytics lib is not loaded’ is closed to new replies.