PhpMyMovie Script! How do i add my Google Analytics Code?

cgFuse

Newbie
Joined
Apr 18, 2009
Messages
40
Reaction score
3
I have never had this problem before trying to add my analytics code to any of my other scripts before but for some reason i cant seem to figure out how to add it to this particular script, nothing ive tried is working. If anyone could possibly help it would be greatly appreciated.
 
Hi cgFuse

Can you specify what files your script is containing? like: main.php, config.php, etc...

cheers olystyle
 
If i go to themes/default/global some of the files i could use are footer.tpl and header.tpl. I think that is why im having trouble, because its a .tpl file and im not sure what that really is.
 
Do the .tpl files acutally contain php? What kind of files are outside of your theme folder?

cheers
 
I think it would be easier if i just uploaded the script, so here it is.

http://www.2shared.com/file/bjgnXR57/PhpMyMovie.html
 
Alright place your analytics snippet in the footer.tpl (/PhpMyMovie/uploads/themes/default/global/footer.tpl)

Code:
//at the very bottom you'll find the body and html closing tags
//Here's where you should place imho the analytics snippet

<script type="text/javascript">
//just a sample snippet from developers.google.com
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _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></body>
</html>

let me know if its working

cheers olystyle
 
Google does not pick up the tracking code and the footer dissapeared from the bottom of the page.

Code:
</tr></table>
</div>
 
<script type="text/javascript">


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35540190-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>


</body></html>
 
Just had a look at the index.php - and from the looks of it the footer.tpl should be loaded by the index.php before the footer.php...
Try to embed the analytics snippet within the footer.php (you can find it in modules/commons/footer.php ) and see if this works..

cheers
 
Just had a look at the index.php - and from the looks of it the footer.tpl should be loaded by the index.php before the footer.php...
Try to embed the analytics snippet within the footer.php (you can find it in modules/commons/footer.php ) and see if this works..

cheers
Awesome! Your a genious! I was worried something was wrong because it was a blank file but it worked! Thanks alot, i have literally tried everything but that lol.
 
Awesome! Your a genious! I was worried something was wrong because it was a blank file but it worked! Thanks alot, i have literally tried everything but that lol.
hey do u know how to put only featured movies in carousel (i dont want to include un-featured movies)????????
 
Back
Top