google-analytics

Add view count to webpage from Google Analytics

五迷三道 提交于 2020-01-16 19:38:28
问题 I am trying to create a view count feature for a webpage. To do this, I created a new property and generated a tracking id from Google Analytics. Is there a way I can use the page vists data from there and display it on the same page that I am tracking? 回答1: You can, but since GA APIs are authenticated, you will need to handle that authentication one way or another . You have basically 3 options: User doing OAuth : by default you would need to implement the OAuth flow like the Query Explorer

Python Google Analytics Management API throws error 403 Forbidden

不羁的心 提交于 2020-01-16 09:05:06
问题 I want to create an automated product data import for Google Analytics using the managament api (google analytics api v3) and python. Now, I am facing the follwing issue: There was an API error : 403 : Forbidden My oAuth works, because I can pull data from analytics. My account should also have sufficient user permissions, because I have created the same function with App Scripts and it worked (using the same property, account and customdatasourceId). There must be something wrong with line

Including Google Analytics Embed API third party dashboard example javascript in my Rails app

风格不统一 提交于 2020-01-15 12:25:12
问题 I am following this example here for the Google Analytics Embed API to implement a GA third party dashboard via Chart.js in my app and I am having trouble on Step 3 where we are including all the javascript libraries. I was able to load the Embed API in my application.js as so (function(w,d,s,g,js,fs){ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}}; js=d.createElement(s);fs=d.getElementsByTagName(s)[0]; js.src='https://apis.google.com/js/platform.js'; fs

How do I get PHP-GA to stop incrementing real-time visitors in google analytics?

余生颓废 提交于 2020-01-15 10:57:27
问题 I'm looking at using php-ga (https://packagist.org/packages/unitedprototype/php-ga) to send simple analytics to GA - basically capturing when an API endpoint is hit. I'm using the code below and it's working well, but GA is treating every endpoint hit (tested by refreshing a test page) as a unique visitor. Has anyone out there seen this before? The API knows 'who' is contacting it, thanks to authentication. Can anyone show me how to tell GA that each refresh is actually a single user session,

Query string breaking page

筅森魡賤 提交于 2020-01-15 10:31:25
问题 A Google Analytics query string on an incoming link breaks the display of my site. Does anyone know why the following would cause my site to fail to load its homepage properly (it appears to prevent the loading of some plugins that the page needs) http://mysite.com/?utm_medium=email While this does not: http://mysite.com/#utm_medium=email And if you know why, how do I fix this? I have incoming links that use the query string method and they are all resulting in the visitor seeing a broken

Google Analytics; using custom variables with events

冷暖自知 提交于 2020-01-15 10:14:17
问题 I've been tasked with adding some Google Analytics events to a web site. I've never used Google Analytics before, and I have the basics working, but despite having read lots of documentation I don't really understand how/if custom variables apply to events. For example, I have code like this when the user clicks a button to view information about a flight: var scope = 3; // page-level scope _gaq.push(['_setCustomVar', 1, 'FlightNumber', FlightNumber, scope]); _gaq.push(['_setCustomVar', 2,

Google Analytics; using custom variables with events

血红的双手。 提交于 2020-01-15 10:13:22
问题 I've been tasked with adding some Google Analytics events to a web site. I've never used Google Analytics before, and I have the basics working, but despite having read lots of documentation I don't really understand how/if custom variables apply to events. For example, I have code like this when the user clicks a button to view information about a flight: var scope = 3; // page-level scope _gaq.push(['_setCustomVar', 1, 'FlightNumber', FlightNumber, scope]); _gaq.push(['_setCustomVar', 2,

session duration more than the default (30 minutes) in google analytics

坚强是说给别人听的谎言 提交于 2020-01-15 10:02:48
问题 In my google analytics the session time is set to 30 minutes. but the avg. session duration that I see in my report tables is more than 30 minutes in some cases. How can it be possible?I am so confused.please please help me. thanks a million Regards 回答1: Main Points This is possible because each time there is activity (event or screen view) in your app, the session timeout timer is reset to the full duration. Inactive time in the app is counted , but only under specific conditions

Google Analytics SDK iOS10

女生的网名这么多〃 提交于 2020-01-15 06:00:08
问题 I have installed Google Analytics from cocoa pod version 3.14 id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:oneTrackId]; crash on iOS 10 in code line NSString *user_id = [tracker get:kGAIUserId]; Error * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[GAITrackerModel valueForKey:]: attempt to retrieve a value for a nil key' 回答1: Apple changed valueForKey: method behavior in iOS 10. Previously calling valueForKey: with argument nil

Google Analytics SDK iOS10

只谈情不闲聊 提交于 2020-01-15 05:59:08
问题 I have installed Google Analytics from cocoa pod version 3.14 id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:oneTrackId]; crash on iOS 10 in code line NSString *user_id = [tracker get:kGAIUserId]; Error * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[GAITrackerModel valueForKey:]: attempt to retrieve a value for a nil key' 回答1: Apple changed valueForKey: method behavior in iOS 10. Previously calling valueForKey: with argument nil