Analytics
2.5K members online now
2.5K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

removing Legacy Analytics

Follower ✭ ✭ ✭
# 1
Follower ✭ ✭ ✭

Hi, 

I was just about to remove the legacy tracking from my site and replace with analytics.js but before I do that could someone confirm that this coding is standard legacy coding?

 

As it seems to be back to front, when compared to Google's help pages.  It maybe that it is tracking someone specific? If so would this need replicating in analytics.js ?

 

Or is analytics.js sufficient when compared to this legacy code?

 

<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("UA-XXXXXXX-1");
pageTracker._trackPageview();
} catch(err) {}</script>

 

Many thanks in advance

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Rob W
June

removing Legacy Analytics

Rising Star
# 2
Rising Star

Hi Rob,

 

The version you have posted is three generations ago,  It's doubtful that you'll find any help docs for it as it was replaced by async ga.js about 8 years ago  Smiley Happy.    But yes, that is the snippet to remove.   You should consider moving your implementation to Google Tag Manager while you are at it.  Smiley Happy

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Rob W
June

removing Legacy Analytics

Rising Star
# 2
Rising Star

Hi Rob,

 

The version you have posted is three generations ago,  It's doubtful that you'll find any help docs for it as it was replaced by async ga.js about 8 years ago  Smiley Happy.    But yes, that is the snippet to remove.   You should consider moving your implementation to Google Tag Manager while you are at it.  Smiley Happy

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

removing Legacy Analytics

Follower ✭ ✭ ✭
# 3
Follower ✭ ✭ ✭

Thanks I have removed, and replace with latest coding. 

 

I tried Tag Manager once with a Magento installation, and 2 months of going backwards and forwards to Google phone help, they said don't use it as it can sometimes not work with Magento installations!! 

 

So even though this isn't a magento installation, I plan to stay well clear of Tag Manager! 

removing Legacy Analytics

Rising Star
# 4
Rising Star

Gotcha.  It's usually easier in the long run but understood.  Smiley Happy

 

-Theo

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn