Call google analytics method _trackEvent() from php -
i need call methode _trackevent() php when execute route. it's possible in php ? me please. exist solution. thx in advance.
_trackevent a) javascript , b) deprecated. can't call php, can use google measurement protocol same results.
the measurement protocol standard api forms basis data collection universal analytics (across devices). specify client id , hit type (in case "event") , necessary parameters depending on hit type.
the api endpoint www.google-analytics.com/collect
. parameter list event looks this:
v=1 // version. &tid=ua-xxxx-y // tracking id / property id. &cid=555 // anonymous client id. &t=event // event hit type &ec=eventcategory // event category. required. &ea=evenaction // event action. required. &el=eventlabel // event label. &ev=1 // event value.
this example uses placeholders (so replace values after equal sign own variables), event label , event value optional. send url parameters via post (per documentation, works, too), via curl or fopen or whatever when executing route.
the example documentation here.
Comments
Post a Comment