views:

507

answers:

5

I'm not good with JavaScript, and this is Google's code. I'm getting a object expected on this, which seems to work fine in other places.

It's the 3rd to the last line (the one with utmSetVar).

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

   <script type="text/javascript">__utmSetVar('aff/VG-CEGBWI');</script>
</BODY>
</HTML>
A: 

Works fine for me when I remove the offending line of code.

I don't know what __utmSetVar('aff/VG-CEGBWI'); does. Can you elaborate?

Eppz
A: 

From what I saw on Google it's for tracking (a cookie) site visitors. Here is an example on how to define it. Unfortunately the page is gone and you can only find it in Google cache:

What is utmsetvar

Cj Anderson
+2  A: 

The utmSetVar function is a one that was available in the old Google Analytics codebase using the "urchin" tracker.

http://www.google-analytics.com/urchin.js

You can use the following to determine which one you are using

http://www.google.com/support/googleanalytics/bin/answer.py?answer=75129

In order to solve your problem you will need to either revert to the old tracking style (easy hack solution) or to consult the google site on the newest method of achieving what you are after.

Robin Day
A: 

Ahh, I see.

I did upgrade to the new code a while back, but used the old method of defining visitor segments. Didn't even occure to me that they may not have ported that over. Strangly, it appears to still be tracking correctly in analytics, but also causing an error.

Thanks

+2  A: 

Thanks for the help guys, the correct code was

pageTracker._setVar('aff/undefined');