measurement-protocol

UserId, CID in measurement protocol

心不动则不痛 提交于 2019-12-04 13:06:41
问题 Measurement protocol To Identify a new user vs. returning user , can we use the user id field . ( i.e we can hash username or other identifier unique to the user and associate it with a particular user . This way we can identify new users vs. returning users effectively. Question on CID -- CID is used to indentify a user's session uniquely till the session expires. Do we have to track the session expiration manually to generate cid per user session ? Pls clarify 回答1: A long time after but

Google Analytics Measurement Protocol

跟風遠走 提交于 2019-12-04 11:10:02
问题 I tried to use google analytics to track some more custom data. So I thought I use the events. The following is the code I tried where I replaced the uuid and user agent : <?php function gen_uuid() { return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0x0fff ) | 0x4000, mt_rand( 0, 0x3fff ) | 0x8000, mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); } $data = array( 'v' => 1, 'tid' => 'UA-*****

What is the rate limit for direct use of the Google Analytics Measurement Protocol API?

谁说我不能喝 提交于 2019-12-03 10:06:23
In the Documentation for Google Analytics Collection Limits and Quotas It gives the rate limits that are implemented by the various Google-provided libraries. I can't seem to find a published rate limit for users that are POSTing directly to measurement protocol ( https://www.google-analytics.com/collect ). Is there one and if so what is it? Edit on 10 July 2015 - A few commenters asked for an example of the kind of data I am sending in. Using a series of calls to wget with a sleep of one second between each call. Here is an example with the app name and tracking code removed: wget -nv --post

Send event to Google Analytics using API server sided

杀马特。学长 韩版系。学妹 提交于 2019-12-03 09:06:21
问题 I have a website where I send events to Google Analytics using javascript function: ga('send', 'event', 'showphone', 'feedback', 'result'); However I also need to send some similar events from server-side using PHP. I tried this quick start tutorial: Hello Analytics API: PHP quickstart for service accounts and reporting works like a charm, but I have no idea how to send event. Could you please show me step-by-step what I should code to send exactly same event like mentioned above. 回答1: Hello

Google Analytics Measurement Protocol

让人想犯罪 __ 提交于 2019-12-03 07:19:55
I tried to use google analytics to track some more custom data. So I thought I use the events. The following is the code I tried where I replaced the uuid and user agent : <?php function gen_uuid() { return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0x0fff ) | 0x4000, mt_rand( 0, 0x3fff ) | 0x8000, mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); } $data = array( 'v' => 1, 'tid' => 'UA-********-**', 'cid' => gen_uuid(), 't' => 'event' ); $data['ec'] = "category"; $data['ea'] = "product";

Send event to Google Analytics using API server sided

北战南征 提交于 2019-12-02 23:20:26
I have a website where I send events to Google Analytics using javascript function: ga('send', 'event', 'showphone', 'feedback', 'result'); However I also need to send some similar events from server-side using PHP. I tried this quick start tutorial: Hello Analytics API: PHP quickstart for service accounts and reporting works like a charm, but I have no idea how to send event. Could you please show me step-by-step what I should code to send exactly same event like mentioned above. Hello Analytics API: PHP quickstart for service accounts is not going to help you at all. That code uses the core

Event Value ? Google analytics / measurement protocol

落花浮王杯 提交于 2019-11-29 20:56:05
How to use event value / view it when I use event tracking with measurement protocol. Currently in events tab in google analytics UI, I can check category , action but cant see the value associated with it that I sent to GA. Thanks Crayon Violent First off, make sure you are passing a correct value to the value argument. The value argument expects an integer value (not string), e.g. // bad _gaq.push(['_trackEvent', 'Category', 'Action', 'Label', "some random string"]); // bad _gaq.push(['_trackEvent', 'Category', 'Action', 'Label', "123"]); // good _gaq.push(['_trackEvent', 'Category', 'Action

Google Analytics proxy

混江龙づ霸主 提交于 2019-11-28 05:32:32
I have a special situation where the sites visitors can access the page from a certain domain but no others. So HTML and assets are no problem as long as they are stored on the server. Google Analytics on the other hand requires a download of analytics.js from Googles servers, which is impossible. So I'm looking for a way to proxy this. The webserver itself has internet access and could relay the trafic. To report to Google about my page view, a single pixel GIF is downloaded from Google, described here: https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview I