Google Analytics in PHP -
i have website displays movietimes. (e.g. movietime.php?movieid=1)
i track 2 things.
- how many times movietime.php has been visited
- 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
Post a Comment