vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
New vBSEO Discount Level for Network Builders Meet vBSEO Team in New York (Nov. 3rd & 4th) 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

New Google Analytics Code

This is a discussion on New Google Analytics Code within the General Discussion forums, part of the vBSEO SEO Plugin category; I've put this here rather than troubleshooting because the new code is not officially part of vBSEO 'yet' (but I ...

Go Back   vBulletin SEO Forums > vBSEO SEO Plugin > General Discussion

Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Reply

 

LinkBack Thread Tools
  #1  
Old 01-09-2008, 05:58 AM
Senior Member
 
Real Name: Stewart
Join Date: Apr 2007
Posts: 184
New Google Analytics Code

I've put this here rather than troubleshooting because the new code is not officially part of vBSEO 'yet' (but I notice that it has been implemented on this forum) so is just a preemptive strike.

Since installing the new Analytics code I've noticed that the registration goal conversions are no longer tracking.

Anyone else tried installing the code and noticed this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 01-09-2008, 09:04 AM
Mert Gökçeimam's Avatar
vBSEO.com Webmaster
vBSEO Total Customer SupportvBulletin HackerBig Board Administrator
 
Real Name: Lizard King
Join Date: Oct 2005
Location: Istanbul
Posts: 7,551
Blog Entries: 3
Send a message via MSN to Mert Gökçeimam
The new Analytics code will be implemented within the new version. However if you want to implement it right now please do the following :

You can modify functions_vbseo.php file for that.

Find
PHP Code:
$newtext preg_replace('#(</body>)#is','
<script src="'
.((($_SERVER['HTTPS'] && $_SERVER['HTTPS']!='off')||isset($_SERVER['HTTP_FRONT_END_HTTPS']))?'https://ssl':'http://www').'.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "'
.VBSEO_ANALYTICS_CODE.'";
urchinTracker();
</script>
'
.'\\1',$newtext,1); 
REPLACE WITH:

HTML 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();
pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
</script>
'.'\\1',$newtext,1);

Last edited by Oleg Ignatiuk; 03-22-2008 at 04:49 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 01-09-2008, 10:11 AM
Senior Member
 
Real Name: Stewart
Join Date: Apr 2007
Posts: 184
Hi Mert

I posted about it a few days ago (Google Analytics has a new tracker?) but I've found that since doing it it no longer tracks registrations (using the funnel).

Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 03-11-2008, 06:13 PM
wld wld is offline
Junior Member
 
Real Name: Milan Rabiska
Join Date: Feb 2008
Posts: 3
Question

Quote:
Originally Posted by Mert Gökçeimam View Post
The new Analytics code will be implemented within the new version. However if you want to implement it right now please do the following :

You can modify functions_vbseo.php file for that.

Find
PHP Code:
$newtext preg_replace('#(</body>)#is','
<script src="'
.((($_SERVER['HTTPS'] && $_SERVER['HTTPS']!='off')||isset($_SERVER['HTTP_FRONT_END_HTTPS']))?'https://ssl':'http://www').'.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "'
.VBSEO_ANALYTICS_CODE.'";
urchinTracker();
</script>
'
.'\\1',$newtext,1); 
REPLACE WITH:

PHP 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();
pageTracker._trackPageview('
.($track_url?"'$track_url'":"").');
</script>
'
.'\\1',$newtext,1); 
Quote:
Originally Posted by woostar View Post
Hi Mert

I posted about it a few days ago (Google Analytics has a new tracker?) but I've found that since doing it it no longer tracks registrations (using the funnel).

Any ideas?


Hi -- I have replaced the old Analytics code with the new one, but I'm getting an error message ("Done, but with errors on page") on pages which are used for a user registration... apparently due to the Google Analytics script on the page.

Affected pages (scripts) are:

1) forum/register.php
2) forum/register.php?do=register
3) forum/register.php?do=addmember


Note: This problem only appears when viewing pages in Internet Explorer, in FireFox it doesn't show any errors.


UPDATE:

I can see the "urchinTracker" code below the new Analytics code on those pages used for the registration. Could that be the problem? I don't see any urchinTracker code on the other pages.


Quote:
<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("UA-XXXXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

<script type="text/javascript">
urchinTracker("/google-funnel/agreement.html")
</script>


Any help appreciated !!



UPDATE:

When I deleted the "urchinTracker" code from the scripts mentioned above all error messages disappeared. I think "pageTracker._trackPageview" inside the new Google Analytics code replaced the function of the old urchinTracker code and they can not be placed together on the same script page.

Last edited by wld; 03-12-2008 at 12:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 03-20-2008, 03:08 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,476
anybody else having problems with this?

i install the code change and i just get white pages on my site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 03-20-2008, 03:31 AM
Member
 
Real Name: Frank
Join Date: Sep 2007
Location: Taiwan
Posts: 33
no problems here.

You seeing anything in your error.log file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 03-20-2008, 11:35 AM
Oleg Ignatiuk's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Oleg Ignatiuk
Join Date: Jun 2005
Location: Belarus
Posts: 21,450
Blog Entries: 1
The urchinTracker(XX) code should be repalced with pageTracker._trackPageview(XX) in this case as well.
__________________
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 03-20-2008, 03:05 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,476
I was referring to Mert's code post, not the extra urchinTracker() stuff.

Nothing in the error log.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 03-20-2008, 04:43 PM
Oleg Ignatiuk's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Oleg Ignatiuk
Join Date: Jun 2005
Location: Belarus
Posts: 21,450
Blog Entries: 1
Looks like there are a couple of slashes missing there (vB parser removes them for some reason), here is the code:
HTML 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();
pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
</script>
'.'\\1',$newtext,1);
__________________
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.


Last edited by Oleg Ignatiuk; 03-21-2008 at 12:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 03-20-2008, 04:56 PM
Mert Gökçeimam's Avatar
vBSEO.com Webmaster
vBSEO Total Customer SupportvBulletin HackerBig Board Administrator
 
Real Name: Lizard King
Join Date: Oct 2005
Location: Istanbul
Posts: 7,551
Blog Entries: 3
Send a message via MSN to Mert Gökçeimam
Quote:
Originally Posted by Oleg Ignatiuk View Post
Looks like there are a couple of slashes missing there (vB parser removes them for some reason), here is the code:
HTML 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();
pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
</script>
'.'\\1',$newtext,1);
The edit breaks page validation

Last edited by Oleg Ignatiuk; 03-21-2008 at 12:09 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11  
Old 03-20-2008, 05:08 PM
Oleg Ignatiuk's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Oleg Ignatiuk
Join Date: Jun 2005
Location: Belarus
Posts: 21,450
Blog Entries: 1
Do you mean html validation (which page)?
__________________
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12  
Old 03-20-2008, 06:14 PM
Mert Gökçeimam's Avatar
vBSEO.com Webmaster
vBSEO Total Customer SupportvBulletin HackerBig Board Administrator
 
Real Name: Lizard King
Join Date: Oct 2005
Location: Istanbul
Posts: 7,551
Blog Entries: 3
Send a message via MSN to Mert Gökçeimam
Breaks validation at showthread pages

[Invalid] Markup Validation of http://www.ayyas.com/guncel-olaylar/22057-gene/ - W3C Markup Validator

If i use the old analytics code everything is ok
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13  
Old 03-20-2008, 09:37 PM
Oleg Ignatiuk's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Oleg Ignatiuk
Join Date: Jun 2005
Location: Belarus
Posts: 21,450
Blog Entries: 1
Please try to enclose js code in html comment:
HTML Code:
<script language="Javascript"><!--
...
//-->
</script> 
__________________
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14  
Old 03-21-2008, 09:19 AM
Junior Member
 
Real Name: Carsten
Join Date: Mar 2008
Posts: 9
I get a plank page after changing the code. Can you please exact post which code I should be replaced with which code?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 03-21-2008, 12:10 PM
Oleg Ignatiuk's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Oleg Ignatiuk
Join Date: Jun 2005
Location: Belarus
Posts: 21,450
Blog Entries: 1
The instruction is included in post#2 above: New Google Analytics Code
__________________
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Need to add advanced _udn into Google Analytics Code Zip-Lock Analysis: Traffic & SERPS 1 03-22-2007 09:13 PM
Got My Google Analytics code today shanemcse Analysis: Traffic & SERPS 10 11-15-2006 12:07 AM
How do I add the Google Analytics Code? Lammypie General Discussion 10 05-22-2006 09:08 PM
2.2.2/2.3.0 Google Analytics Code Keith Cohen Bug Reporting 4 12-08-2005 01:11 PM
Finding my Google Analytics Code Michael Troubleshooting 1 11-21-2005 04:24 PM


All times are GMT -4. The time now is 11:27 AM.


Powered by vBulletin Version 3.8.0 Beta 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.