SID-01154: Google Analytics Plugin (for non qualified domain) does not work
| Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
|
| Category: |
CategoryPlugins |
Server OS: |
|
Last update: |
14 years ago |
My Twiki's url is
http://name/twiki/bin/view/
where 'name' is non a fully qualified domain. However I have created a UA-XXXXXXX-X by using incorrect url just to make it be qualified and get aWebPropertyId.
Next I installed GA Plugin in Tiwiki using this UA-XXXXXXX-X but it seems not working correctly. Status is saying that data is receiving successfully but it only recieved very poor data few days ago and now does not recieve any data at all (I know for fact that page have visitors).
Any thoughts?
--MC- 2011-04-27
Discussion and Answer
Hello.
When you dont have a FQDN you can insert a
_gaq.push(['_setDomainName', 'none']);
in your Google tracking script. The full script could be
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXXX']);
_gaq.push(['_setDomainName', 'none']);
_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>
--
EnriqueCadalso - 2011-05-08
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.