Analytics
2.8K members online now
2.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Is this a valid way to implement GA code?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Our company has an external page that is completely updated and controlled by a third party. We asked them to add a GA code so that we could track our traffic. The way the code was added to our external site looks very different from the suggested website tracking script that is suggested by google analytics. 

 

Here is the html script they added to our site: 

GA on page code.PNG

 

Is this still correct? We've been having a few issues and I'm wondering if they are being caused because of the way this script was written. 

 

1 Expert replyverified_user

Is this a valid way to implement GA code?

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

It should work. But the only way to be certain is to open the page in Chrome, and use the Tag Assistant and/or GA Debugger extensions to see what is sent to Analytics. You can also visit the page and check your real time reports to see if your visit appears.

 

Is this a valid way to implement GA code?

Top Contributor
# 3
Top Contributor

Hi, Alexander J,

 

Can you elaborate on the issues you are seeing?

 

When the GA code is altered, you have no guarantee that it will track your data correctly - now it becomes one more thing you need to troubleshoot. The code should not be altered, and now because it, it's difficult to tell what the issues may be. I might be wrong, but it looks like the 3rd party is using their own local copy of the analytics.js library (under /assets/javascripts/analytics.js). There's a danger to this because the library may not receive any updates from Google if it doesn't come directly from them.

 

 

 

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Is this a valid way to implement GA code?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Nicky, Thank you for your response. One issue I'm currently having is that each page on the site is being reported with the incorrect URL. Example: if the actual page is: www.example.com/aboutus google is reporting it as: www.example.com/example.com/aboutus I have checked and double checked all of the property settings and view settings, but everything seems to be in order there. Also, when I sign in I get an error that reads 

"Security problem. Please try reloading the page.

We cannot verify your account credentials. Please verify your account information, then sign in again."
 
After I click close it still allows me access, but it's worrying none the less. I'm not sure that either of these problems are related to the code, but I've used GA in the past and never had any problems with it until now. 

 

Is this a valid way to implement GA code?

Top Contributor
# 5
Top Contributor

Hi Alexander,

 

Have you checked your filters to see if you have something that's appending the hostname? Might be an advanced filter, or search and replace...

 

The sign-in issue might be something unrelated and uncontrollable by you (ie. it's probably something on Google's end). Can you try another browser or another workstation?

 

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn