vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
vBSEO Total Support Team Launches DeskPro New vBSEO Discount Level for Network Builders vBSEO 3.2.0 GOLD Has Landed Success with vBSEO = 600ore Web Visitors + $1400 in a Day! Crawlability Inc. Files for SEO Technology Patent
se sw

Adding Code After Analytics

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 ...

Go Back   vBulletin SEO Forums > vBSEO SEO Plugin > Troubleshooting

Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-19-2008, 12:43 AM
Citricguy's Avatar
Senior Member
 
Real Name: Josh
Join Date: Nov 2006
Location: Maui, Hawaii
Posts: 143
Blog Entries: 7
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> 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #2  
Old 09-19-2008, 02:42 AM
briansol's Avatar
Senior Member
vBSEO Pre-Release TeamDesign for SEOBig Board Administrator
 
Real Name: Brian
Join Date: Apr 2006
Location: Central CT, USA
Posts: 5,776
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);
}
replace with

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);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #3  
Old 09-19-2008, 04:51 AM
Citricguy's Avatar
Senior Member
 
Real Name: Josh
Join Date: Nov 2006
Location: Maui, Hawaii
Posts: 143
Blog Entries: 7
Thank you Brian, that worked flawlessly!

While on the topic, might I ask, do you and if so how do you track ad-clicks on your sites?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #4  
Old 09-19-2008, 02:18 PM
briansol's Avatar
Senior Member
vBSEO Pre-Release TeamDesign for SEOBig Board Administrator
 
Real Name: Brian
Join Date: Apr 2006
Location: Central CT, USA
Posts: 5,776
I do not track other than the adsense report itself.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 05:42 PM.


Powered by vBulletin Version 3.8.0 Release Candidate 2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.