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 3 years ago by arnaudv33.
Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter arnaudv33

    (@arnaudv33)

    It doesn’t change anything but I identified the problem. The instagram widget isn’t working anymore. Here is a demo of the theme I’m using with the intagram widget at the bottom on the page: https://wp-royal.com/themes/ashe-pro/demo/jeans-is-always-trendy/

    Please note I still have an issue when I add

    ?ao_noptimize=1

    at the end of the link. I must disable both plugin (AO & async) to be able to see it whereas when it’s activated it only shows the instagram button, no images are displayed.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, you’ll have more exclusions to do in that case I guess, instagram-slider-widget/assets/js/ and/or ashe-pro/assets/js/custom-plugins.js maybe? go for some trial & error, you’ll get there 🙂

    Thread Starter arnaudv33

    (@arnaudv33)

    You are the best ! Thank you very much for your help!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! 🙂

    you beat me to it 🙂

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘tarteaucitron.js’ is closed to new replies.