google-analytics

Track swipes with Google Analytics

∥☆過路亽.° 提交于 2019-12-11 09:44:04
问题 I have a swipe functionality on my mobile page, and I want to used touchstart, touchend, and touchmove to track the swipe functionality across the device without affecting the scrolling. Here is my code. jQuery('.first-frame').bind('touchmove', function(event) { _gaq.push(['_trackEvent', 'Landing-Page', 'Swipe-Toggle-Color', '0259_2190']); }); 回答1: If it's possible to only monitor the swipeleft and swiperight events in jQuery Mobile instead, do so. Otherwise, you can set a global variable on

Google Analytics V3 - How to create custom segments for API Service Accounts

六月ゝ 毕业季﹏ 提交于 2019-12-11 09:42:58
问题 I need to access custom segments in Google Analytics via reporting the API. There is no trouble with it, except that custom segments are not shareable across multiple profiles/users set in Google Analytics, so a segment has to be created for each profile. And in the case of using a Service Account generated through Google API's Console, segments have to be created for that account – how do I log in to Google Analytics with a Service account having Client ID, email address and public key

Is there a reliable way to get the referring url without relying on $_SERVER?

筅森魡賤 提交于 2019-12-11 09:38:54
问题 I'm customizing the content of my site based on Google and Bing PPC campaigns. If a user clicks a PPC ad, they see certain content. If they come to the site via organic seach, they see different content. If they come direct, they see a third content. It's working but not consistently; results are not behaving as expected, and often PPC ads will show the organic content. I know HTTP_REFERER can't be trusted, so maybe this is causing the problem. In any case, is there a better way to do this?

How to insert Google Analytics after clicking a button?

夙愿已清 提交于 2019-12-11 09:33:27
问题 I'm trying to insert Google Analytics snippet after clicking a button, and therefore counting it as a visit. Is it possible to do without needing to reload the page? 回答1: You can use Event Tracking, namely trackPageView (found on David Walsh's site]: _gaq.push(['_trackPageview', 'url-to-track.html']); On a button: var button = document.getElementsByTagName("button")[0]; button.addEventListener("click", function() { //Button click event alert("Tracking pageview"); _gaq.push(['_trackPageview',

How to correctly integrate google API with React

淺唱寂寞╮ 提交于 2019-12-11 09:29:28
问题 I've integrated the Google analytics Embed API with my React app and I'm able to render correctly a graph. This is my container, which renders a line chart through the component UsersChart : class StatsContainer extends Component { constructor(props) { super(props); initAnalyticsAPI(); } render() { return ( <Query query={GET_ACCESS_TOKEN}> {({ loading: loadingToken, error: errorToken, data: { getAnalyticsAccessToken } }) => ( <Query query={GET_BASIC_STATS}> {({ loading: loadingStats, error:

Google Analytics: How to merge canonical URLs for historical data

女生的网名这么多〃 提交于 2019-12-11 09:27:23
问题 I have a single-page online app which relies on query strings. Google Analytics tracking was added, however canonical meta wasn't added until a few days later, so now Analytics is showing several entries for the same page because of a difference in the query string, e.g. "/app/?s=4324,543,12421" and "/app/?s=5234,86754" whereas the canonical is just "/app/". Is there a way to merge data for the extra pages (in Reporting > Behavior > Overview) in GA which have since been canonicalised? 回答1: To

How to pass additional arguments to callback functions in javascript when using .execute()?

橙三吉。 提交于 2019-12-11 09:14:56
问题 I'm working with javascript for Google Analytics API but I'm no more than a novice in JS. I have C++ and Java knowledge and I can get along with logical thinking but some things puzzle me. In GA API I get to make a function call like this: gapi.client.analytics.data.ga.get({'ids':'<tableID>', 'start-date':'<startDate>', 'end-date':'<endDate>', 'metrics':'<metrics>', 'filters':'<filters>', 'samplingLevel':'HIGHER_PRECISION',}).execute(putToVar); putToVar() is a user defined function defined

Firebase vs Google Analytics

天大地大妈咪最大 提交于 2019-12-11 09:14:15
问题 I have installed Firebase to my Android and iOS apps, I can check the stats on computer, but can't check them on my iphone Google analytics app. Is there any way or app where can I check the stats or do I need to install also Google analytics to my apps as well? 回答1: When you use Google Analytics for Firebase (formerly known as Firebase Analytics) the analytics results show up in the Firebase console. They do not (currently) show up in the Google Analytics dashboard. 回答2: You can have a

Looping through a list of tuples to make a POST request with each tuple

安稳与你 提交于 2019-12-11 08:58:39
问题 I have a list of tuples here: import datetime import requests from operator import itemgetter original = [(datetime.datetime(2013, 11, 12, 19, 24, 50), u'78:E4:00:0C:50:DF', u' 8', u'Hon Hai Precision In', u''), (datetime.datetime(2013, 11, 12, 19, 24, 50), u'78:E4:00:0C:50:DF', u' 8', u'Hon Hai Precision In', u''), (datetime.datetime(2013, 11, 12, 19, 24, 48), u'9C:2A:70:69:81:42', u' 5', u'Hon Hai Precision In 12:', u''), (datetime.datetime(2013, 11, 12, 19, 24, 47), u'00:1E:4C:03:C0:66', u

Google Analytics: 100% Drop off from landing page

夙愿已清 提交于 2019-12-11 08:53:02
问题 I have a Web site built in Drupal 7 - we'll call it website.com. Outside of that site, I have a campaign specific landing page - we'll call that website.com/landingpage. On this page, there are a couple of buttons back to the main website (website.com). I have goals set up that track a user from that landing page, back to the main site home page, then through a few other steps. for some reason, even though I know users are clicking through to the site, I'm getting a 100% drop-off from the