Tutorial :javascript object expected



Question:

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>  


Solution:1

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.


Solution:2

Thanks for the help guys, the correct code was

pageTracker._setVar('aff/undefined');


Solution:3

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?


Solution:4

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »