Empty custom dimension does not appear into API queries

446 views
Skip to first unread message

minie...@gmail.com

unread,
Sep 30, 2015, 6:48:27 AM9/30/15
to Google Analytics Reporting API
Dear all,

we have implemented Enhanced Ecommerce tracking with two custom dimension at the Product Level.


We have found that when querying for "Product Sku" (a standard dimension) and "Product Details View" (standard metrics) we obtain right figures.


When querying for "Product Sku, "Product Details View", "Custom dimension 1" we don't receive the right numbers: looking at the event level we find out that "Custom Dimension 1" was setted to "" (empty string).


Could the empty string be the cause in the reporting error?


Many thanks in advance for you any help you can provide me.
Roberto

Matt

unread,
Sep 30, 2015, 12:51:22 PM9/30/15
to Google Analytics Reporting API
I would guess the problem is on the collection side.
Are you using analytics.js?
Are you using data import to collect the product data?

Ensure that you have enabled enhanced Ecommerce on the view (profile).
Data import can also take 24 hours to process. Also if you are not using query time data import, the process will only affect hits going forward.
-Matt



On Wednesday, September 30, 2015 at 3:48:27 AM UTC-7, 

minie...@gmail.com

unread,
Oct 1, 2015, 2:43:04 AM10/1/15
to Google Analytics Reporting API

Hi Matt,

We are not using Data Import for product. We would work only tracking correctly products using analytics.js (we don't have a fixed product list, it's always evolving).

Our main concern is that when passing dimensionXX:"" this empty value seems not materialized when exporting; let me explain using two product details view:

addProduct -> ProductSku:123, dimension2:red
addProduct -> ProductSku:456, dimension2:""

When Querying for ProductSku, ProductDetailsView I obtain
123,1
456,1

When Querying for ProductSku, ProductDetailsView I obtain
123,1

Item 456 is missing, the difference is th empty diension2.

Do you already experimented this behavior?
Roberto

Matt

unread,
Oct 1, 2015, 1:42:14 PM10/1/15
to Google Analytics Reporting API
Hello,
Thank you for clarifying the issue.
What I believe you are seeing is the intended behavior. The work arounds would be alway include a value on the collection side, even if the value is "N/A". But for past values you would need to make two API requests to see the products values without a custom dimension set.

Below I have put some tips for everyone's reference.
Debugging the Reporting side:
When asking for help it is always good to include the full request? Especially if there are filters or segments that could be causing issues?
For example I would suggest creating the request in the Query Explorer and sharing the links with the group.

Debugging the Collection side:
Verify that custom dimensions are of the intended scope. Verify that the view you are using has enhanced ecommerce enabled.
You should look in your network tab of your chrome dev tools/ JavaScript Console, and verify the hits are being sent.  Also the realtime reporting view is a good way to verify that hits are coming in.
Also the Google Analytics Debugger chrome extension prints useful information to the JavaScript console. And finally if you are using the Measurement Protocol I would suggest checking out the Hit Builder tool.

Finally if you need assistance with API code or collection code the Folks over at StackOverflow are always good at helping debug these sort of things.
-Matt
Reply all
Reply to author
Forward
0 new messages