Free Arcade Script
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Demo
Help
Search
Store
Gallery
Contact
Login
Register
Free Arcade Script
»
Forum
»
FAS Customization
»
Addons/Modifications
»
V1.x
»
Adding Google Analytics to php
Recent
« previous
next »
Print
Pages: [
1
]
Author
Topic: Adding Google Analytics to php (Read 5660 times)
emil
Newbie
Posts: 26
Force: +0/-0
Adding Google Analytics to php
«
on:
March 26, 2010, 04:23:38 PM »
Following up on a conversation from yesterday with Kurt and Adam, whom i thank again for the great support. I tried this myself and it works.
For any PHP pages, put the following code in a file (for example, analyticstracking.php) and upload it to your site. Then, add the following line to each template page before the </body> tag: <?php include_once("analyticstracking.php") ?>
<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("youranalyticsid");
pageTracker._trackPageview();
} catch(err) {}</script>
Logged
Print
Pages: [
1
]
« previous
next »
Free Arcade Script
»
Forum
»
FAS Customization
»
Addons/Modifications
»
V1.x
»
Adding Google Analytics to php