tarteaucitron.js
-
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?
- The topic ‘tarteaucitron.js’ is closed to new replies.