简体   繁体   中英

Custom dimensions not working in Google Analytics

I have a problem with setting up & showing Google Analytics Custom Dimensions. I have successfully setup a dimension in the web interface called "Client" In code I am sending a view properly like this:

    [tracker setCustom:1 dimension:@"Client"];
    [tracker sendView:@"my view"];

GAI dispatch says that data has been sent successfully. But when I try to view my data in reporting - Screens tab and apply "Client" dimension. All my data disappear from table saying "There is no data for this view." Also there are some bugs when switching number of rows per page.

Anyone who has custom dimensions successfully applying, how you do that?

Did you define a segment with a condition that matches your dimension value? It did the trick for me.

See this guide for creating segments: https://support.google.com/analytics/answer/3124493?hl=en

You can select the segment you've created in the reports, and if the dimension was set correctly and GA received data correctly, then your segment should show hits.

Note that you might see data with a delay of a day or so.

I just did some Google Analytics development recently, for SDK 3.0, but I was struggling as well with the custom dimensions. One important thing to note is that custom dimensions are set once, and then with all the calls they are automatically passed, so you can set them when you are initializing all the Google Analytics classes.

Is also important to note that in your example you are saying that the Custom Dimension with key 1 will have the value Client. So in your backend you should see for the key "Client" the value "Client", considering that the "Client" key corresponds to the value 1.

Have you tried the debugging of google analytics, so you can be sure you are sending the right URL?

For more help, can you give us a screenshot of the backend where you defined the custom dimensions? Is just a flag you have to enable, as you can see in this page: https://developers.google.com/analytics/devguides/collection/ios/v2/advanced#testing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM