Please excuse my ignorance - about Google Analytics, web APIs generally, etc etc etc.
I’m using the Analytics Collection demo project.
I’ve built in both debug and release modes.
I’ve inserted my Google Analytics API key.
My internet connection is stable.
I have found the folder where unsent events would be saved. There is nothing there which suggests to me the connection was made successfully.
But there’s nothing I can see in Google Analytics that looks anything like a button press event log. And whenever an event should be sent I consistently get errors of the type:
AnalyticsCollection[67957:1179079] TIC Read Status [3:0x0]: 1:57
Which I understand is a TCP ENOTCONN (not connected error).
Please help! Any advice on what I should expect would help me feel less crazy. Thank you
What OS are you running your app on? Do you have the correct permissions to connect to an external server?
Also GA has a considerable lag - you can see live events coming in on some of the screens but you won’t be able to query the collected data for something like 12 hours.
Thanks t0m, I’m on High Sierra 10.13.3. I’m also not sure about external server connection permissions (unsure how to check for that despite a respectable amount of Googling), but I have used web APIs successfully in tutorial apps that I’ve built on this machine before (admittedly on previous OSX versions, but with no special configuration from me).
The responses from this should give us a bit more info. Can you successfully collect analytics from requests sent by other methods (curl from the command line, for example)?
So I took that reformatted string back into the demo code and pasted it as the argument to postData.add().
The result was that I stopped getting an ENOTCONN on the following connection line
const auto success = webStream->connect (nullptr);
But this only happened when I stepped through the code. Running the code (not debugging), the errors turned up with both formats.
I guess I’ve now sent some valid startup hits, although I still can’t see them in GA. Maybe this is because it takes a while for them to come through, as you said. Or maybe it’s because my GA page is for an iOS product, whereas I should have made it for a (general) measurement protocol product. Will try to suss that too. Cheers!
Right. The debug endpoint is showing valid hits from JUCE.
It looks as if this comes down to (1) me not understanding GA and how complicated it is to set up to show your raw hit data helpfully, (2) the confusion added by the ENOTCONN errors (which still can’t explain) and the mountains of inexplicable information coming into GA (according to which my app has users in California, NY, Florida and Alaska, which is impossible).