google-analytics

Avoiding race conditions in Google Analytics asynchronous tracking

 ̄綄美尐妖づ 提交于 2019-12-23 02:17:06
问题 I am having issues with many of my events (maybe 20%) not getting recorded in Google Analytics. These are all events called with onclick on an image button that posts a form. I believe that the code isn't running fast enough to submit the events to Google before the browser moves on to the next page. What I would like to do is check the state of _gaq's queue and make sure there are no pending events before completing my Javascript. _gaq seems a little cryptic to me, but it does have an

Multiple Google Tracking Codes on AMP pages

此生再无相见时 提交于 2019-12-23 01:24:32
问题 Is there a way to add different Google Analytics tracking accounts? I've been looking around but I only find examples and sites are using 1 single account: <script type="application/json"> { "requests": { "pageview": "https://example.com/analytics?url=${canonicalUrl}&title=${title}&acct=${account}", "event": "https://example.com/analytics?eid=${eventId}&elab=${eventLabel}&acct=${account}" }, "vars": { "account": "ABC123" }, "triggers": { "trackPageview": { "on": "visible", "request":

Google Analytics embed api not working on Angular 2 app

只谈情不闲聊 提交于 2019-12-23 01:21:09
问题 I am using the following code to embed Google Analytics api into my Angular 2 app: Mycomponent.html <div id="embed-api-auth-container"></div> <div id="chart-container"></div> <div id="view-selector-container"></div> <script> gapi.analytics.ready(function() { /** * Authorize the user immediately if the user has already granted access. * If no access has been created, render an authorize button inside the * element with the ID "embed-api-auth-container". */ gapi.analytics.auth.authorize({

Using Google Analytics To Track Fragments

限于喜欢 提交于 2019-12-23 00:23:32
问题 Just need to know the proper way to implement Google analytics to track when a user is on a fragment in real time this is what is do now @Override public void onResume() { super.onResume(); Tracker myTracker = parentActivity.getTracker(); myTracker.setCustomMetric(1, (long) 1); myTracker.sendView("Music View"); } the getTracker class is in my main activity and just returns the instance of tracker in the main activity Any help would be much appreciated! 回答1: Mochini's answer uses Google

PHP API for Google Analytics

丶灬走出姿态 提交于 2019-12-22 23:13:29
问题 I wanna start using Google Analytics PHP API. I found 2 libraries and I can't understand which one should I use and what is the main difference between them: gapi-google-analytics-php-interface and google-api-php-client P.S. The main reason to use this API is requirement to work with goals. 回答1: google-api-php-client is for Google API's and not specifically for Google Analytics. gapi-google-analytics-php-interface is a library that connects to your Google Analytics account and extracts data.

Google Analytics Multiple Custom Dimension

◇◆丶佛笑我妖孽 提交于 2019-12-22 19:44:33
问题 I am working on Google Analytics chart on my site and in the tracking code I want two add two custom dimension (One is a User ID). I am doing it this way, am I doing it right ? ga('create', 'UA-XXXX', {'userId': spUserId}); ga('set', { 'dimension1': spUserId, 'dimension2': jobAidId }); ga('send', 'pageview'); 回答1: Yes, that's correct: ga('set', {'dimensionX': valueX, 'dimensionY': valueY, 'dimensionZ': valueZ}); ga('send','pageview'); You could also send them with other hits too: ga('set', {

Firefox “Bad request” caused by corrupt google tracking cookie

喜夏-厌秋 提交于 2019-12-22 18:16:02
问题 We have an issue on our site whereby some Firefox users are receiving a "Bad Request" message when they visit our site (nothing else, just the words "Bad Request"!) This would appear to be due to a corrupt google tracking cookie, possibly __utmz (one person delete the google cookies in turn and once that one was removed the site came back to life.) Our website uses this Javascript google tracking code: var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

GTM data layer eventCallback function

旧城冷巷雨未停 提交于 2019-12-22 17:06:24
问题 So i have Ecommerce code setup in GTM data layer, but after that is sent to Analytics i want the page to be redirected so i know i should be using eventCallback but it is not working for some reason. <body> <script> dataLayer = [{ 'transactionId': '56833', 'transactionAffiliation': 'TestName', 'transactionTotal': 1540.00, 'transactionTax': 385, 'transactionShipping': 0, 'transactionProducts': [{ 'sku': 'FFSS44HH', 'name': 'test', 'category': 'TestCategory', 'price': 1540.00, 'quantity': 2 }],

Google Analytics Not Showing Correct Active Page in Rails App

核能气质少年 提交于 2019-12-22 13:32:38
问题 I have a Rails 4 App with the Google Analytics js right before the end of the body to work with Turbolinks. However, unless I specifically reload the page I'm on, the Active Page always shows up as '/'. Is there any way to correct this? 回答1: You can use the google-analytics-turbolinks gem and add the script as usual. Update: The only thing the gem does, is that it adds this coffeescript file into the assets folder: if window.history?.pushState and window.history.replaceState document

Error installing google analytics on iOS app

橙三吉。 提交于 2019-12-22 13:30:10
问题 I was trying to integrate google analytics into my project, and I was surprised that it requires cocoapods to install google analytics now. I followed the documentation here: https://developers.google.com/analytics/devguides/collection/ios/v3/?hl=en I called pod init on terminal, and then I've edited by podfile to # Uncomment this line to define a global platform for your project # platform :ios, '6.0' target 'Unity-iPhone' do pod 'Google/Analytics', '~> 1.0.0' end target 'Unity-iPhone Tests'