Problem dispatching with google mobile analytics for iphone

前端 未结 2 1288
灰色年华
灰色年华 2021-01-14 09:36

I have integrated Google mobile analytics into my iphone app, but for some reason the page views and events are not dispatching.

I put this into my app delegate appl

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 10:04

    The Google Analytics stop sending data when you try to send a non formatted "URL", if it is not initiated with the "/" or contain some specific chars, it will start only returning errors.

    The best thing to do is, verify that you are placing the "/" on the beginning of you URL and before sending, format your URL to avoid any problem, by doing:

    
    NSString* pageURLString = [pageURL stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
    

    Encoding it with NSASCIIStringEncoding, will format the URL properly. The same can be used when tracking an event.

提交回复
热议问题