google-analytics

Enable Demographics and Interests reports in Universal Analytics

我只是一个虾纸丫 提交于 2019-12-20 12:06:58
问题 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

Can't find headers for GoogleAnalytics-iOS-SDK with Cocoapods 0.37, Swift, frameworks

做~自己de王妃 提交于 2019-12-20 11:40:42
问题 Using cocoa pods 0.37.0 in a Swift project, with use_frameworks! set in the podfile, I am unable to access the header files for the GoogleAnalytics-iOS-SDK pod. How should I access the Google Analytics pod's headers in my app? I have tried; import GoogleAnalytics_iOS_SDK In a Swift file, cocoapods 0.36 style. But there's no framework created anymore so no good. #import <GoogleAnalytics_iOS_SDK/GAI.h> In the bridging header, but doesn't work (no module map ?) I have read that the behaviour for

How dangerous is e.preventDefault();, and can it be replaced by keydown/mousedown tracking?

怎甘沉沦 提交于 2019-12-20 10:47:15
问题 I'm working on a tracking script for a fairly sophisticated CRM for tracking form actions in Google Analytics. I'm trying to balance the desire to track form actions accurately with the need to never prevent a form from not working. Now, I know that doing something like this doesn't work. $('form').submit(function(){ _gaq.push(['_trackEvent', 'Form', 'Submit', $(this).attr('action')]); }); The DOM unloads before this has a chance to process. So, a lot of sample code recommends something like

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

不问归期 提交于 2019-12-20 10:44:22
问题 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! 回答1: 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

Tracking two different user types with Google Analytics?

孤街浪徒 提交于 2019-12-20 10:25:21
问题 We've got a site with two types of users: Guests Registered users What we are looking for is a method to track both types of users within just one Google Analytics profile. We believe a registered user stays more in the site and has a higher page view count that a guest. Could this be possible within just one profile? Could there be a way to show custom reports in the profile page to show both user's average time and guests average time? I know Analytics is such a powerful application, but I

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

爱⌒轻易说出口 提交于 2019-12-20 10:22:42
问题 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

How does google analytics track events when user navigates to other page inside one domain

巧了我就是萌 提交于 2019-12-20 10:15:43
问题 In Google's documentation it is said that an event can be tracked in the following way: <a onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', opt_value]);">click me</a> or older version: <a onclick="pageTracker._trackEvent('category', 'action', 'opt_label', opt_value);">click me</a> I was looking with Firebug to the request that are made when a click on a link and I see there aborted request: http://www.google-analytics.com/__utm.gif?utmwv=4.7.2&utmn=907737223&.... This

Should Google Analytics go in the head or bottom of an HTML page?

拥有回忆 提交于 2019-12-20 10:07:34
问题 Google advises putting the google analytics script right before closing the </head> . However, I would prefer to combine it with the rest my javascript that are now all together in a cached, external file, which is loaded at the bottom of my HTML file. Can I do it my way? If so, what am I risking then/what's the cost of putting the below code not in the head but at the bottom of the HTML? <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-22180365-1']); _gaq

Query Google Analytics by User ID

…衆ロ難τιáo~ 提交于 2019-12-20 09:52:35
问题 Is there a way to query results using the Core Reporting API (v3) and filtering those results by the User ID assuming that it is being sent to Google Analytics properly? I've googled this question a lot and read a whole bunch of articles but I did not find one place that does that. Moreover, the fact that I cannot see the User ID anywhere in the reporting interface makes me doubt that this is even possible. I'm guessing I will have to dome something similar to what is recommended here in

Tracking link clicks with google analytics?

我的梦境 提交于 2019-12-20 08:25:03
问题 I'm a complete beginner with Google Analytics, and I need to know how to set it up so that it can track the number of clicks a link on my website gets? For example I have a link: <a href="https://google.com">link</a> I know I'm supposed to put an onClick event on there somewhere but I don't have any idea how it links to Google Analytics? Is this the correct Onclick code: onClick="_gaq.push(['_trackEvent', 'Link', 'Click', 'Banner Advert1']);" 回答1: You probably want to use event tracking -