react-native-google-analytics icon indicating copy to clipboard operation
react-native-google-analytics copied to clipboard

RCTNetworkingQueue Error

Open LukeAvery92 opened this issue 9 years ago • 9 comments
trafficstars

Getting error about received data was not string or was not a recognised encoding?

My request:

var gaEvent = new GAHits.Event('test', 'test', 'test', 1); ga.send(gaEvent);

LukeAvery92 avatar Dec 01 '15 15:12 LukeAvery92

I also ran into this error. Same as #17

edit:

After some testing, I think this has to do with Google's Measurement Protocol Reference. I used one of my other tracking id for one of my websites and the event was tracked. However when I used my app's tracking id, no event was tracked.

Also the error message is being emitted via React's RCTNetworking.m 320:1. Since the response from the url (https://ssl.google-analytics.com/collect) is a gif, the message can be disregard as no response is actually needed after a request with the data payload has been sent.

I'm still working out why this API works with normal website tracking ids and not app tracking ids

the4dpatrick avatar Dec 04 '15 15:12 the4dpatrick

Great detective work, @the4dpatrick. I was about to use Google Web Analytics as a fallback - good to know I can still use this package in that event. I'll look into the GA documentation as well and see if I can help.

This is also the same as #2, which is already closed. We should probably keep the conversation here.

nicholasalanbrown avatar Dec 06 '15 15:12 nicholasalanbrown

https://github.com/facebook/react-native/issues/1780

No one has indicated what version of iOS they're running - looks like this should be fixed starting with iOS 8? If this is not the case then we should re-open this issue citing a regression.

lwansbrough avatar Dec 07 '15 07:12 lwansbrough

I was on 9.1 iphone 4s

LukeAvery92 avatar Dec 07 '15 09:12 LukeAvery92

@the4dpatrick, I'm confused at to how you are getting it working with GA for web. I tried this as well as the normal mobile tracking and was not successful either way. Could you share a code snippet to show how you are using it? Thanks

tgoldenberg avatar Dec 07 '15 13:12 tgoldenberg

@LukeAvery92, thanks, I'll reopen that issue.

lwansbrough avatar Dec 07 '15 17:12 lwansbrough

@lwansbrough I'm running iOS 9.1 on a 5S. It's definitely not related to the iOS version. I've tried on both a physical device and the Simulator but can't get any visits to be recorded in GA.

nicholasalanbrown avatar Dec 07 '15 21:12 nicholasalanbrown

@nicholasalanbrown It's interesting that the visits aren't being recorded. Are requests sent when you MITM your phone/computer? The issue that the bug report pertains to is explicitly the response causing problems. This is a problem with React Native core. Any other issues you see that don't result in this problem should be filed separately.

lwansbrough avatar Dec 07 '15 21:12 lwansbrough

I've created a separate issue here #21 @lwansbrough @tgoldenberg

the4dpatrick avatar Dec 07 '15 21:12 the4dpatrick