Google Analytics in PHP -


i have website displays movietimes. (e.g. movietime.php?movieid=1)

i track 2 things.

  1. how many times movietime.php has been visited
  2. how many times movieid=1 has been visited (same goes movieid=2, movieid=3 etc)

how should that?

i did below before </head> not getting results.

<!-- google analytics tracking -->         <script type="text/javascript">             var _gaq = _gaq || [];             _gaq.push(['_setaccount', 'ua-xxxxxxxx-x']);             _gaq.push(['_setcustomvar', 1, 'movieid', <?php echo $movieid; ?>, 1]);             _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> 

i have changed accountid property that's not issue. :|

you're not getting results because of line:

    _gaq.push(['_setaccount', 'ua-xxxxxxxx-x']); 

ua-xxxxxxxx-x needs replaced property id.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -