0

Configuring Google Analytics Module, I mistakenly kept the example code during the first 2 configurations of the module: UA-673320-6.

Then I finally out the correct code:UA-30183564-3.

From looking at my website's page source, it appears all 3 configurations are in the header as javascript snippets?

I am not sure how to get Google Analytics setup so that it is linked to my website?

<script type="text/javascript">
<!--//--><![CDATA[//><!--
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-673320-6']);
_gaq.push(['_setDomainName', '.XXXXX.com']);
_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);
})();
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-673320-6']);
    _gaq.push(['_setDomainName', '.XXXXX.com']);
    _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);
})();
//--><!]]>
</script>
<script type="text/javascript" src="http://XXXXX.com/sites/all/modules/umi_docs_migrate/js/sphinx.js?m17g0h"></script>
<script type="text/javascript" src="http://XXXXX.com/sites/XXXXX.com/files    /js/js_IDBX5SzkJ9gGNq7x-qOE_2DZsexqguTJQGMKvi4w-Uw.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var _gaq = _gaq || [];_gaq.push(["_setAccount",    "UA-30183564-3"]);_gaq.push(["_setDomainName", ".XXXXX.com"]);var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30183564-3']);
_gaq.push(['_trackPageview']);_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);})();
//--><!]]>
</script>

2 Answers 2

2

I would like to offer an alternative. I have always had issues with putting my analytics into the analytics module. I have experienced what you have experienced, plus I question why this code has to go into a module? The fewer modules you have the faster your site performs.

I always get the code from Google and then hard code it into the theme files. In drupal 7, this would go into your html.tpl.php just before the tag, just as google instructs. That is called for every single page, so no pages will ever go without it. Plus, it makes your code lighter and one less module to worry about. It has always been the best solution for me.

note: if you are using d6 it would have to go into each page.tpl.php template or its derivative if you have more than that one. Hope that helps.

1

Have you tried clearing your cache? If that doesn't work, uninstall the module and reinstall it, making sure that when you configure it you set the correct Google Analytics ID on the first go...

I've never experienced this, but you might have stumbled across a bug. Make sure you're using the most up to date version of the module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.