Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 May 2012 at 22:52 UTC
Updated:
9 Jun 2012 at 19:30 UTC
Hi All,
This is probably me missing something. I have the module installed and it works fine, pop-up works fine. The problem is that adding the code http://drupal.org/node/1568590#comment-6033170 example by dagomar (obviously ignoring the php in the original as it is JS, and putting my own ID in)
if (Drupal.eu_cookie_compliance.hasAgreed()){
var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-xxxxxxx-xx"]);_gaq.push(["_trackPageview"]);(function() {var ga = document.createElement("script");ga.type = "text/javascript";ga.async = true;ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga, s);})();
}
It just doesn't work. I have tried various things, cleared the cache (browser and server), restarted varnish, httpd, etc. but nothing, analytics is not enabled. First, and probably dumb question, but I wan't to double check, where should the code be place?
The logical place to me was the theme template file.
If someone could confirm, I would be grateful.
Regards,
Nick
Comments
Comment #1
nickbits commentedI have just tried this on a fresh install of D6, only addition is the Zen theme. I have added this to the page.tpl file:
The if statement doesn't work. Reading the project page, I am assuming this should only work in modules, is there a way to make it work in a theme?
Would appreciate any feedback.
Regards,
Nick
Comment #2
Miszel commentedHi Nick,
I suspect that your code runs before my code is loaded. Try the following and let me know if it works for you:
Comment #3
nickbits commentedHi Marcin,
You are a star. Some times I wish I could kick myself. I should have thought of that, don't know why it didn't occur to me. Anyway, thanks again, much appreciated.
Regards,
Nick
Comment #4
Miszel commentedNo problem. Thanks for using this module.
Comment #5
paardje commented