AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a Dev(test) and a Prod environment for my application. Both instances use the same property, but I use filters to distinguish between hits generated from the Dev and Production instance of the application. 

As part of a new requirement, I now need to add a custom dimension to the GA data currently being captured. From what I see in the documentation, this can only be set up at the Property level. The documentation also says that this will result in the generation of a new tracking code.

So my questions are:

1. Once I set up the custom dimension and metrics before I start the code changes on Dev, will GA then stop capturing any subsequent hits on the Production site (since the Prod site still uses the old tracking code). It will take the updated code implementation more than a month to get to Production, since it will be bundled with other functional changes.

 

2. What happens to the existing data that has been captured so far, before the new tracking code came into effect?

 

3. Is there a recommended way to approach this? Should I just use a different property for my DEV instance so I can test the changes without impacting the Prod analytics?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Sabeena S
April 2017

Test custom dimension and metric setup before go-live

[ Edited ]
Top Contributor
# 8
Top Contributor

@Jay A excellent suggestion re using GTM!!

@Sabeena S

Setting up custom dimensions does not result in a new tracking code.

You need to manually make the changes to the tracking code yourself in order to make the custom dimensions and metrics work once they have been created and 'turned on' in the GA Interface.

 

Depending on what you want to track.. you may not need to edit the tracking code snippet itself.
eg you may want to add a user scoped custom dimension via an onsubmit event, when someone submits a contact form,

so as to segment site visitors that have previously contacted a company via form.

You can then add these changes to the dev setup only for testing.. before deciding to add the changes to the production environment

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Test custom dimension and metric setup before go-live

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)
Are you able to link to the documentation that is being referenced regarding the generation of a new tracking code.
(I'm a bit puzzled by this)

Usually you would navigate to the GA Admin area.. select the relevant Property and then in the Property column towards the bottom.. click Custom Definitions to expand options and then click Custom Dimensions to access the area where these would be created and setup within the GA Interface
https://support.google.com/analytics/answer/2709829?hl=en&ref_topic=2709827#set_up_custom_dimensions

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Here are some links.

https://support.google.com/analytics/answer/2709829
https://support.google.com/analytics/answer/3455600?hl=en

 

Quoted from one of the articles:

After you create custom dimensions or metrics in your property, you must also modify your tracking cod

Re: Test custom dimension and metric setup before go-live

Top Contributor
# 4
Top Contributor

Thanks, I appreciate that, its easier if i can see what docs are being referenced
Modifying
the tracking code doesnt require creating an entirely new Property with a different tracking id, it involves modifying the existing tracking code snippet. You cant create custom dimensions and metrics for a property that is not already created, as you noted .. they are created/configured at the Property level.


The linked pages explain what modifications may need to be done to the existing tracking code once dimensions and/or metrics are setup for an existing property via the applicable GA settings.

dims-mets01.jpgdims-mets02.jpg

 

 

 

If you already differentiate dev and production hits via filter(s).. then I'm assuming testing on the dev setup with modified tracking code should not affect the reporting for the production site.

 

 

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thank you. So once the tracking code changes after I have set up the custom dimension/metrics, can I use the new tracking code on my dev code, and still continue to use the old tracking code on Production? Will the old tracking code continue to capture the Prod traffic until the DEV implementation is moved to the Prod environment?

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

You might want to look at using Tag Manager, if possible. It's much more flexible, you can build variables that will send the data to different GA properties if you are on the Dev or Prod site, and it's easier to customize in most cases (such as generating custom events, dimensions and metrics).

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Thank you Jay A. I am trying to use the same property across different environments using filters.

My question is if I can continue to use the old tracking code in Production code, if I have added a custom dimension to the property (resulting in a new tracking code).

Marked as Best Answer.
Solution
Accepted by topic author Sabeena S
April 2017

Test custom dimension and metric setup before go-live

[ Edited ]
Top Contributor
# 8
Top Contributor

@Jay A excellent suggestion re using GTM!!

@Sabeena S

Setting up custom dimensions does not result in a new tracking code.

You need to manually make the changes to the tracking code yourself in order to make the custom dimensions and metrics work once they have been created and 'turned on' in the GA Interface.

 

Depending on what you want to track.. you may not need to edit the tracking code snippet itself.
eg you may want to add a user scoped custom dimension via an onsubmit event, when someone submits a contact form,

so as to segment site visitors that have previously contacted a company via form.

You can then add these changes to the dev setup only for testing.. before deciding to add the changes to the production environment

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Test custom dimension and metric setup before go-live

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

My apologies. I confused the tracking 'code' with the tracking 'ID' that is automatically generated for the property :-(

I see now that when it says 'tracking code', the documentation is only referring to the changes that need to be made in the javascript code to include the data for the custom dimensions.

Test custom dimension and metric setup before go-live

Top Contributor
# 10
Top Contributor

Nps.. happy to hear that is now sorted out:-)

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here