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.3K members online now
3.3K 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

Custom dimension remain undefined and do not collect any data

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi all!

 

We are trying to implement custom dimensions using the dataLayer and GTM. Our problem is that when we test the tags in the preview mode the custom dimensions are always "undefined". here's our implementation: 

dataLayer.push({
			'ecommerce': {
				'purchase': {
					'actionField': {
						'id': '76345867',	// Transaction ID. Required for purchases and refunds
						'dimension9': '90',
						'tax':'14.00',
						'revenue': '0.00', 
						'country': 'Azerbaijan',
					},
					'products': [{
						'id': '512',
						'name': 'Booking Request', 
						'price': '14.00',
						'brand': '50', 
						'category': '511', 
						'quantity': 1,
						'dimension5': 14,
					}]
				}
			}
		});

As scope I set dimension9 as "Hit" and dimension5 as "Product" in GA and the following set up in GTM (example for dimension5):

Screen Shot 2016-02-05 at 13.17.03.jpg

Does the fact that one custom dimension is in the actionField and another is in the ProductField affect the data collecting? 

What do you think is the issue?

 

Thank you very much in advance!

Stefano

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Stefano B
February 2016

Re: Custom dimension remain undefined and do not collect any data

Top Contributor
# 4
Top Contributor
Hi Stefano B,

"dimension9" should be included with something like an event or pageview, and not within the ecommerce object itself. So when you push your ecomm dataLayer, you should also push something like an event where you include that particualr dimension.

'"dimension5" looks good though. so not sure why that isn't showing up for you. You can use a tool like GA Debugger (for Chrome) to see if you can see that dimensions when you send in your ecomm data. You probably already know this, but just pushing the ecomm data to the dataLayer doesn't mean it's in GA.

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

View solution in original post

Re: Custom dimension remain undefined and do not collect any data

Top Contributor
# 2
Top Contributor
Hi Stefano B,

Dimension9 should be included in a hit rather than within the ecomm object itself. Also, I presume that you have 'dimension5': {{booking_nights}} in the code.
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: Custom dimension remain undefined and do not collect any data

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Nicky Y, thanks for your answer.
-What do you mean with "Dimension9 should be included in a hit"? Should I move it to ProductField or anywhere else?
-About 'dimension5', as you can see is the last key-value pair in the ProductField. Is that incorrect?
Marked as Best Answer.
Solution
Accepted by topic author Stefano B
February 2016

Re: Custom dimension remain undefined and do not collect any data

Top Contributor
# 4
Top Contributor
Hi Stefano B,

"dimension9" should be included with something like an event or pageview, and not within the ecommerce object itself. So when you push your ecomm dataLayer, you should also push something like an event where you include that particualr dimension.

'"dimension5" looks good though. so not sure why that isn't showing up for you. You can use a tool like GA Debugger (for Chrome) to see if you can see that dimensions when you send in your ecomm data. You probably already know this, but just pushing the ecomm data to the dataLayer doesn't mean it's in GA.

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