google-analytics

Enable Demographics and Interests reports in Universal Analytics

旧城冷巷雨未停 提交于 2019-12-03 01:26:26
I want to enable demographics and interests reports with the Universal Analytics tracking code. The generated tracking code for my site looks like this: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-999999999-9', 'whatever.com'); ga('send', 'pageview'); </script> Under Display Advertiser Features there is

Issue using Google Analytics with Require.js

若如初见. 提交于 2019-12-03 00:23:27
I'm using require.js ( http://requirejs.org/ ) for a number of functions on my site and so far it seems to be working well. I've run into an issue when trying to include Google Analytics code though. The code seems to refuse to add a utm.gif and is not sending off a beacon to Google. I'm wondering if it's a scope thing. define(function() { var Analytics = {}; Analytics.Apply = function() { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' ==

How to embed or recreate a Google Analytics Graph in a custom CMS

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 00:21:40
I would like to know how to create a graph with Google Analytics (maybe using the api), but I'm unsure if there is already a plugin or tutorial on how to do this. The Javascript API reference at Google.com sucks. Also any reference to how to create a line graph (canvas element?) would be great too. Thanks! Carles Barrobés I learned to use the Google Visualization API (the one used by analytics, and the one I believe you refer to) from the examples at https://developers.google.com/chart/interactive/docs and found it quite clear. You can use examples of different graphs from the Gallery as well:

Firebase authentication vs AWS Cognito

心不动则不痛 提交于 2019-12-03 00:18:41
问题 We are building a mobile and web app on AWS using API Gateway and Lambda and are currently evaluating if we should use all the AWS Mobile Servcies (Cognito, Analytics, Mobile Hub, etc) or if we should use Firebase instead (which offers some advantages like remote config). I think using the non-funtional part of firebase like Analytics, Remote Config, Crash Reports, Notification should be fine with the AWS backend. The part were I am not certain is the Authentication Layer. AWS Cognito

PHP Google Analytics API - Simple example

久未见 提交于 2019-12-03 00:16:18
I am trying to set some basic example of using Google Analytics with this library: https://github.com/google/google-api-php-client For starter I have: <?php require_once 'Google/Client.php'; require_once 'Google/Service/Analytics.php'; $client = new Google_Client(); $client->setApplicationName("Client_Library_Examples"); $client->setDeveloperKey("MY_SECRET_API"); //security measures $service = new Google_Service_Analytics($client); $results = $service->data_ga; echo '<pre>'; print_r($results); echo '</pre>'; Q: How to get data from Google Analytics from this query ? /* https://www.googleapis

Is it possible to put Google Analytics code in an external JS file?

a 夏天 提交于 2019-12-02 23:36:32
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-XXXXXXX-1"); pageTracker._trackPageview(); } catch(err) {} Would it be possible to call this script from an external JS file? I wanted to to something like: <script type="text/javascript" src="googleanalytics.js" ></script> and put one of these on each of my HTML pages. The code I have above will be inside googleanalytics.js Google's

Running Google Analytics in iframe?

橙三吉。 提交于 2019-12-02 23:32:02
Our company runs a web site (oursite.com) with affiliate partners who send us traffic. In some cases, we set up our affiliates with their own subdomain (affiliate.oursite.com), and they display selected content from our site on their site (affiliate.com) using an iframe. Example of a page on their site: <html> <head></head> <body> <iframe src="affiliate.example.com/example_page.html"> ...content... [google analytics code for affiliate.oursite.com] </iframe> [google analytics code for affiliate.com] </body> </html> We would like to have Google Analytics tracking for affiliate.oursite.com. At

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

Universal Analytics and signup with Facebook

感情迁移 提交于 2019-12-02 22:59:05
I have a website (theneeds.com) that allows signup via Facebook. We're running several campaigns, e.g. on Facebook itself, and we'd like to properly track signups from the different campaigns. The problem is with Universal Analytics: when a user signs up with Facebook, she triggers a new session thus loosing the campaign reference. Two possible solutions are: remove the analytics tracking on the signup form (i.e. the page that causes the new session to start) add facebook.com to the referral exclusion list Unfortuantely both have disadvantages, so I'm wondering if there is any best practice or

Google Analytics - Access api without login

点点圈 提交于 2019-12-02 22:39:18
I had successfully configured google analytics api and get successful data. I want to access analytics api without gmail login. i.e. I will hard code credentials to for login, but how to do it with PHP? Is there any api function to achive this task (for PHP) Thanks! The Hello Analytics API: PHP Quickstart Guide for Service Accounts will walk you through the steps necessary to create and add a service account to your existing Google Analytics Account/Property/View. Once you download have the php client libs and the p12 file downloaded from developer console you can create an authorized