Analytics
2.2K members online now
2.2K 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

Renaming the ga object in the analytics.js and its impact

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi all, 
 
Hope you are all good. 
 
I need an advice and insight. 
 
I want to implement one peculiar analytics code. That code is in conflict with 'ga' object in the GA code. They advise in order to resolve this predicament I am to rename the 'ga' object in the code itself. Like this: https://developers.google.com/analytics/devguides/collection/analyticsjs/renaming-the-ga-object. 
 
My questions are: 
1. Will this rename impact any of my past analytics and what? 
2. I assume it will mess up with the events code - because now its is set like: 
 
 ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
 
 Is my assumption right? 
 
3. Lets assume I will rename my 'ga' object into 'analytics'. Will I need to change the future events code to 'analytics' ('send' , 'event'....)
 
4. Ultimately, what other impact of renaming the 'ga' object should I expect?
 
Thanks a lot! Smiley Happy 

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Dave_Davis (Top Contributor)
November 2015

Re: Renaming the ga object in the analytics.js and its impact

Top Contributor
# 2
Top Contributor
Hi Nikola,

Yes, you'll need to rename all instances of "ga".
It won't affect your historical data in any way and it won't have any other impact either.

Let me know if you have any more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Marked as Best Answer.
Solution
Accepted by Dave_Davis (Top Contributor)
November 2015

Re: Renaming the ga object in the analytics.js and its impact

Top Contributor
# 2
Top Contributor
Hi Nikola,

Yes, you'll need to rename all instances of "ga".
It won't affect your historical data in any way and it won't have any other impact either.

Let me know if you have any more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Renaming the ga object in the analytics.js and its impact

Top Contributor
# 3
Top Contributor
Hi Nikola K,

Just to add to Arnold's response, the only thing you may need to consider is if you eventually use GTM. GTM still uses the "ga" object name (even though you don't really see it being called).

Hope this helps.
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

Re: Renaming the ga object in the analytics.js and its impact

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Thanks for the answer. Smiley Happy

No further questions.

Re: Renaming the ga object in the analytics.js and its impact

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
I dont use GTM. Smiley Happy

Thanks for the reply. Smiley Happy