vBulletin Search Engine Optimization
This is a discussion on Adding Code After Analytics within the Troubleshooting forums, part of the vBSEO SEO Plugin category; I need to add HTML Code: <script src= "/clktrk. js " type= "text/javascript" > </script> When I add it to ...
| |||||||
Enhancing 80 million pages. | Register | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| ||||
| ||||
| Adding Code After Analytics
I need to add HTML Code: <script src="/clktrk.js" type="text/javascript"></script> When I add it to the very bottom of the footer template it still shows up above the Analytics code. Here's what I need HTML Code: <!-- ANALYTICS STUFF :) --> <script src="/clktrk.js" type="text/javascript"></script> </body> |
|
#2
| ||||
| ||||
| vbseo uses a template replace realtime psuedo-code: replace($output, '</body>', 'GA code </body>') In order to get it after this, you will need to make a plugin with a higher execution order than vbseo (5) so it runs after and does the same thing. Or, you can direct-edit the vbseo file that does it, includes/functions_vbseo.php line 1774 find Code: $newtext = preg_replace('#(</body>)#is','
<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"><!--
var pageTracker = _gat._getTracker("'.VBSEO_ANALYTICS_CODE.'");
pageTracker._initData();
'.$more_tracking.'
pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
//-->
</script>
'.'\\1',$newtext,1);
}
Code:
$newtext = preg_replace('#(</body>)#is','
<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"><!--
var pageTracker = _gat._getTracker("'.VBSEO_ANALYTICS_CODE.'");
pageTracker._initData();
'.$more_tracking.'
pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
//-->
</script>
<script src="/clktrk.js" type="text/javascript"></script>
'.'\\1',$newtext,1);
}
|
|
#4
| ||||
| ||||
|
I do not track other than the adsense report itself.
|
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Google Analytics code | hiken | Feature Requests | 1 | 08-21-2008 09:20 PM |
| About new Analytics code | bonjurkes | General Discussion | 2 | 01-23-2008 08:00 PM |
| how to install analytics code | BOLT | General Discussion | 2 | 06-17-2007 08:46 PM |
| How do I add the Google Analytics Code? | Lammypie | General Discussion | 10 | 05-22-2006 09:08 PM |