سؤال

If I have a code that request a page monitored by Google analytics the get response is 200 OK , but it's not logged with Google analytics does any one experienced this behavior ?

هل كانت مفيدة؟

المحلول

Chances are if you are using curl or something similar to request the page the javascript on that page is not being executed. Google analytics code writes a tag to the document when the page has loaded and that script then connects to GA and logs the visit. The users browser is what executes the JS, curl and the like just return the page source outputted from the server.

نصائح أخرى

The response isn't immediate. How long are you waiting until you check to see if your response has been recorded?

Also are you logging from a public domainname.com or is from your local webserver that can't be accessed publically?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top