Reputation: 10800
I need to execute a google analytics script on a site using curl. What are the reporting features that will be available to me for that curl request ?
To make my question more clearer, suppose i have a website www.abc.com which has analytics code on it and if i connect to www.abc.com from www.xyz.com using curl, in the analytics report of www.abc.com will the request i made using curl show ?
What are the parameters that wont show ? since there is no navigator there wouldnt be screen resolutions, color depth, or any other javascript based features. any other reporting features that wouldn't be available to me ?
I need the following to show up :
one issue that Im unsure of is Google's cookies and whether (since i might also be using proxies) these need to be cleared. The ultimate outcome is that I need to be able emulate site traffic as if it is coming from a variety of visitors....
IF the entire thing is not technically possible,is there any other way i can simulate diverse traffic into my google analytics account ?
Upvotes: 7
Views: 11729
Reputation: 5745
You can send events directly to Google Analytics using the Measurement Protocol, creating GET or POST requests directly with the tool of your choice.
See reference here: https://developers.google.com/analytics/devguides/collection/protocol/v1/reference
Upvotes: 6
Reputation: 37305
So, the other answers are right: CURL doesn't execute JS, and there are some methods of automated requests that do.
Other methods to simulate diverse traffic to your account include:
Upvotes: 13
Reputation: 60213
Instead of curl, use a command-line tool that does JavaScript, like HTTPUnit (which includes Rhino). I have heard about WATIR too but never tried.
Those happen to be testing tools, but I guess you can use them to trigger Google Analytics too.
Upvotes: 2
Reputation: 36637
No, because Google Analytics is based on Javascript and curl doesn't process HTML or Javascript.
Upvotes: 1