I have a web service in C# with several web methods that on the basis of metrics and dimensions requested return a Json formatted report. From a web application I make some requests to the web service to get reports and elaborate returned data.
I would like to get statistics based on the Client ID, the code with the forms
096ff5bf-bdf8-4389-9624-26e987693dd5 or 1002177718.1495250719, but I cannot find any adequate dimension to get this.
I saw that I should create a custom dimension, but I could not understand how I can do this, and where to put the customized dimension on my web service. Someone can help me? Thanks
Asked
Active
Viewed 1,165 times
0

Alfredo Torre
- 678
- 1
- 9
- 25
1 Answers
0
In Google Analytics client is not exposed to UI for reporting. So you can't just grab it via API and get the data. You need to send the client ID via custom Dimension to GA.
How to do? In your website where you have placed GA / GTM snippet, you need to perform some actions
- Crete a custom Dimension as client id in GA property. Note down its index.
- If you are using GTM, please create a custom JS variable to get cookie value from a cookie named
_ga
. This contains the client id. (There are different methods to get the client id) - Send the variable as custom dimension along with the page view hit to the custom dimension index you have created in Step-1
- Create / pull reports based on this dimension via C#

Tushar Gupta
- 15,504
- 1
- 29
- 47
-
Thanks for your answer, I have another doubt. I couldn't understand, from the various tutorials that I've read, where do I have to add the custom JS variable, on the app where I call Google Analytics API, or on the site that I have to monitor? Beacuse I can't modify Javascript on the sites. – Alfredo Torre May 23 '17 at 13:49
-
Are you using GTM ? – Tushar Gupta May 23 '17 at 16:05