*
*
*
*
ForumsRegister | Login 
Subject: JS Error - Object Expected
Prev Next
You are not authorized to post a reply.

AuthorMessages
mediademonUser is Offline
Member
Member
Posts:3

12/11/2008 7:41 AM Alert 
Hi

Here's my script...

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='http://www.dnnstuff.com/" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXX-1");
_setDomainName("mydomain.com");
pageTracker._trackPageview();
</script>

Errors on:

_setDomainName("mydomain.com");

Should this be:

pageTracker._setDomainName("mydomain.com");

???

Kind regards

Mediademon
dnnstuffadminUser is Offline
DNNStuff Founder
Site Member
Site Member
Posts:1261


12/11/2008 8:15 AM Alert 
Hi MediaDemon,

What version of the Google Analytics module are you using?


Richard Edwards
DNNStuff Founder
mediademonUser is Offline
Member
Member
Posts:3

12/11/2008 8:24 AM Alert 
Hi Richard

Was using the latest download... 3.0.2 ?

Have since removed it though as it was affecting the site... hard coded it instead.

Here are the differences in code:

GOOGLE

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='http://www.dnnstuff.com/" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXX-1");
pageTracker._trackPageview();
} catch(err) {}</script>

DNNSTUFF

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='http://www.dnnstuff.com/" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXX-1");
_setDomainName("mydomain.com");
pageTracker._trackPageview();
</script>

Hope this helps!

Kind regards

Mediademon
dnnstuffadminUser is Offline
DNNStuff Founder
Site Member
Site Member
Posts:1261


12/11/2008 8:30 AM Alert 
Thanks for the report. I just posted a new release that fixes the error. The _setDomainName line has been changed to pageTracker._setDomainName.

The _setDomainName line only gets added if the Domain name field has something in it in the module settings. Normally it isn't necessary but is sometimes used to track against multiple domains.

The spec is as follows:

_setDomainName(newDomainName)

Sets the domain name for cookies. There are three modes to this method: ("auto" | "none" | [domain]). By default, the method is set to auto, which attempts to resolve the domain name based on the location object in the DOM.

Set this method explicitly to your domain name if your website spans multiple hostnames, and you want to track visitor behavior across all hosts. For example, if you have two hosts: server1.example.com and server2.example.com, you would set the domain name as follows:

pageTracker._setDomainName(".example.com");



Be sure to use a leading "." in front of your domain name, as illustrated here. The leading period ensures that the cookie will be accessible across all hosts. Otherwise, the cookie is accessible only in example.com.

* Set this method to none in the following two situations: You want to disable tracking across hosts.
* You want to set up tracking across two separate domains. Cross-domain tracking requires configuration of the _setAllowLinker() and _link
methods.

pageTracker._setDomainName("none");

Richard Edwards
DNNStuff Founder
mediademonUser is Offline
Member
Member
Posts:3

12/11/2008 8:38 AM Alert 
Hi Richard

Pleased to be of help... :)

And thanks for the swift response...!

Kind regards

Mediademon
You are not authorized to post a reply.
Forums > Free Modules > Google Analytics > JS Error - Object Expected



ActiveForums 3.6
DotNetNuke Sponsor
Copyright (c) 2005-2008 DNNStuff
*
Terms Of Use   Privacy Statement