Support » Plugin: Async JavaScript » tarteaucitron.js

  • Resolved arnaudv33

    (@arnaudv33)


    Hello,

    I just installed tarteaucitron.js in order to be GDPR compliant and I’ve got on issue because even if I exclude it, it’s still not working. I used the official website to install it: https://opt-out.ferank.eu/en/install/.

    Here is what I added in functions.php (child theme):
    add_action( ‘wp_enqueue_scripts’, ‘tarteaucitron_load’ );
    function tarteaucitron_load() {
    wp_enqueue_script( ‘tarteaucitron’, ‘/tarteaucitron/tarteaucitron.js/tarteaucitron.js’ );
    }
    add_action( ‘wp_head’, ‘tarteaucitron_init’ );
    function tarteaucitron_init() {
    ?><script>
    tarteaucitron.init({
    “hashtag”: “#tarteaucitron”,
    “highPrivacy”: false,
    “orientation”: “top”,
    “adblocker”: false,
    “showAlertSmall”: true,
    “cookieslist”: true,
    “removeCredit”: false
    });
    </script><?php
    }

    add_action( ‘wp_footer’, ‘tarteaucitron_services’ );
    function tarteaucitron_services() {
    ?><script>
    tarteaucitron.user.analyticsUa = ‘XXXXXXXX’;
    tarteaucitron.user.analyticsMore = function () { ga(‘set’, ‘anonymizeIp’, true); };
    (tarteaucitron.job = tarteaucitron.job || []).push(‘gtag’);
    (tarteaucitron.job = tarteaucitron.job || []).push(‘youtube’);
    (tarteaucitron.job = tarteaucitron.job || []).push(‘recaptcha’);
    </script><?php
    }

    In the console, it’s displaying the error below:
    Uncaught ReferenceError: tarteaucitron is not defined.

    Could you please help me?

    • This topic was modified 2 years, 8 months ago by arnaudv33.
Viewing 4 replies - 16 through 19 (of 19 total)
Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘tarteaucitron.js’ is closed to new replies.