1,510 questions
158
votes
5
answers
149k
views
Regular expression for a string containing one word but not another
I'm setting up some goals in Google Analytics and could use a little regex help.
Lets say I have 4 URLs
http://www.anydotcom.com/test/search.cfm?metric=blah&selector=size&value=1
http://www....
21
votes
14
answers
33k
views
How to Block Spam Referrers like darodar.com from Accessing Website?
I have several websites that get daily around 5% of visits from spam referrers. There is one strange things I noticed about this referrers: they show in Google Analytics, but I cannot see them in my ...
673
votes
35
answers
811k
views
No matching client found for package name (Google Analytics) - multiple productFlavors & buildTypes
Context:
I'm trying to set up Google Analytics for my app. (having 4 custom buildTypes and more than a few productFlavors)
It works fine when I select the Build Variant which has the applicationId ...
136
votes
3
answers
60k
views
What does google-services.json really do?
I work on adding Google Analytics and GCM services to my current app.
On the guide for both services implementation, google asks developer to generate a json file: google-services.json and put it ...
64
votes
9
answers
75k
views
Track event in google analytics upon clicking form submit
I need to track an event in google analytics when someone fills out a form and clicks submit. The resulting page that comes up is a standard dashboard-type page, so in order to track the event on ...
201
votes
6
answers
156k
views
Which browsers support <script async="async" />?
On December 1, 2009, Google announced support for asynchronous Google Analytics tracking.
The asynchronous tracking is achieved using the async directive for the <script> tag.
Which browsers ...
326
votes
12
answers
229k
views
Can you test google analytics on a localhost address?
I have to test out my new GA account on my local machine.
Will this work just by copying the standard snippet supplied by Google onto the page ?
I don't want to spend 24 hours waiting to see if it ...
23
votes
3
answers
14k
views
NoClassDefFoundError when GoogleAnalyticsTracker.getInstance()
I'm tring to use com.google.android.apps.analytics.GoogleAnalyticsTracker
but got NoClassDefFoundError when
GoogleAnalyticsTracker.getInstance();
I'm sure that libGoogleAnalytics.jar is included in ...
5
votes
2
answers
3k
views
How to access object property with invalid characters
I am writing an Angular app that interfaces with a Google Analytics API already in use. The data returned by Google is prefixed with "ga:" as in the example "ga:newVisits".
If I use the expression {{...
103
votes
8
answers
71k
views
How to test android referral tracking?
I'm implementing some code to do my own referral tracking on downloads from the Android market.
See Android referral tracking does not work for an idea of what my app is doing.
How can I test if ...
45
votes
13
answers
73k
views
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define
When I add the configurations for google analytics to my Android project and build the project I get the following error:
:app:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com....
29
votes
1
answer
26k
views
Why are porn sites appearing in my Google Analytics data?
I deployed a web app a couple of days ago and installed Google Analytics on it to track activity.
Almost everyday, I have at least one recorded pageview pointing to a site like www.pornhub-forum.ga/...
173
votes
15
answers
110k
views
Analytics Google API Error 403: "User does not have any Google Analytics Account"
I'm creating an script, based on Google Analytics step-by-step guide from this page:
https://developers.google.com/analytics/resources/tutorials/hello-analytics-api
Authorization is done without ...
28
votes
3
answers
44k
views
Chrome extension adding external javascript to current page's html
I am adding some external JavaScript to the end of the page via my chrome extension. The external JavaScript then tries to post some data back to the server, however that is not taking place.
The ...
222
votes
21
answers
123k
views
Tracking Google Analytics Page Views with AngularJS
I'm setting up a new app using AngularJS as the frontend. Everything on the client side is done with HTML5 pushstate and I'd like to be able to track my page views in Google Analytics.
46
votes
14
answers
37k
views
How to use Google Analytics with Phonegap without a plugin?
I am making an app and I want to get analytics from the users. I tried to use the Phonegap Plugin, but I didn't have any luck trying to implement it.
I was wondering if it was possible to get Google ...
11
votes
1
answer
10k
views
Firebase - log events from server side cloud functions [duplicate]
We've developed a mobile app using Firebase and we want to add analytics. We want to add to the analytics several system events that are triggered from existing cloud functions. I do not see any way ...
261
votes
20
answers
169k
views
PageSpeed Insights 99/100 because of Google Analytics - How can I cache GA?
I'm on a quest to reach 100/100 on PageSpeed and i'm almost there. I'm trying to find a good solution to cache Google Analytics.
Here is the message I get:
Leverage browser caching
Setting an ...
143
votes
8
answers
68k
views
Should I put the Google Analytics JS in the <head> or at the end of <body>?
Google gives me a piece of javascript and tells me to include it in the <head>.
Can I put it at the end of <body> or will some side effects occur if I do that?
52
votes
6
answers
112k
views
how to get the Google analytics client ID
When you are creating a new instance of analytics.js by running
ga('create', 'UA-XXXXXXX-Y', {'cookieDomain': 'none'});
GA creates a unique client Id.
I want to fetch this id and use it for my own ...
38
votes
1
answer
28k
views
simple hit counter for page views in rails
I've found several solutions for this problem, for example railstat from this post:
Page views in Rails
I have a bunch of articles and reviews which I would like a hit counter filtered by unique IPs....
37
votes
9
answers
27k
views
Javascript Redirect with Google Analytics
I need help figuring out how to successfully redirect while including Analytics code.
I have a subdomain setup http://buuf.fractalsystems.org
The subdomain is actually just a subfolder http://...
28
votes
5
answers
52k
views
iOS: disable/remove FirebaseAnalytics
I update 'Google/Analytics' from CocoaPod and get FirebaseAnalytics.
After that, each time I run project, the FirebaseAnalytics turns out many error loggings.
Currently I don't use this library and ...
14
votes
3
answers
19k
views
Get Android Google Analytics referrer tag
We're planning to use Google Analytics to track ad click-through referrals, through the Android Market, to our application.
According to the Google Documentation the referrer tag comes through via an ...
202
votes
15
answers
102k
views
Is there a setting on Google Analytics to suppress use of cookies for users who have not yet given consent
According to EU Article 5(3) of the E-Privacy Directive (a.k.a 'The Cookie Laws'), web sites that target EU users have to gain opt-in consent from users before they set a cookie.
See ICO Guidance
I ...
123
votes
16
answers
91k
views
How to set up Google Analytics for React-Router?
I'm trying set up Google Analytics on my react site, and have come across a few packages, but none of which has the kind of set up that I have in terms of examples. Was hoping someone could shed some ...
85
votes
4
answers
34k
views
AnalyticsService not registered in the app manifest - error
I am trying to implement google analytics service to android app using the following documentation provided in sdk:
https://developers.google.com/analytics/devguides/collection/android/v4/
I am ...
51
votes
7
answers
48k
views
What is "var _gaq = _gaq || []; " for?
The Async Tracking code in Google Analytics looks like this:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document....
47
votes
6
answers
8k
views
How do you integrate Universal Analytics in to Chrome Extensions?
The chrome extension guide has a tutorial for the old analytics install: https://developer.chrome.com/extensions/tut_analytics.html
The instructions just say to link to the https version and update ...
45
votes
7
answers
17k
views
Google Analytics in Android app - dealing with multiple activities
I was pretty excited to see how easy it is to set up Google Analytics with my app, but the lack of documentation has me sitting with a few questions. The only information that I can find is right from ...
9
votes
3
answers
24k
views
Schedule query in BigQuery
I have a BigQuery query which unions two tables (daily Google Analytics exports). What I want is to save the query as a view or table but have that final view/table update automatically everyday as ...
1
vote
2
answers
695
views
How do you deal with multiple values in a single cell separated by comma?
Student
Fruits
Foo
Apple,Banana
Bar
Orange
Baz
Lemon,Orange
How do I quantify/analyze the column Fruits with multiple values in a single cell separated by comma?
I created multiple helper columns, ...
75
votes
11
answers
74k
views
Angular 4+ using Google Analytics
I'm trying to use the Google Analytics with angular 4, but i can't find any @type to ga.js in ts.
For a quick solution I used this in every component:
declare let ga: any;
Following how I resolved ...
45
votes
10
answers
23k
views
Track campaigns with Google Analytics without query string parameters?
Is there a supported way in Google Analytics to track a campaign without having to use query string parameters.
In Analytics you can tag a link to your site with query string parameters such as ...
30
votes
3
answers
4k
views
Google Analytics blocks Android App
I use Google Analytics in my Android App and it works well. After updating the SDK (google play service) to the current version (6587000) the app hangs up at startup at following line 8 of 10 times:
...
18
votes
2
answers
9k
views
Google Analytics GIF request not sent
I'm having some troubles setting up Google Analytics. I downloaded the Google Analytics Debugging extension for Chrome and if I take a look at the console, the __utm.gif request is never sent. I ...
11
votes
3
answers
5k
views
Google Analytics custom dimension not working: gtag set() method issues
I'm trying to set up a custom dimension for GA4 called chain_id using the gtag set method. I've also added a custom_map property in the config but I'm not even sure if that is necessary. The issue is ...
11
votes
4
answers
18k
views
Total Sessions in BigQuery vs Google Analytics Reports
I'm just learning BigQuery so this might be a dumb question, but we want to get some statistics there and one of those is the total sessions in a given day.
To do so, I've queried in BQ:
select sum(...
5
votes
1
answer
3k
views
Can I track my Firebase function in Google Analytics?
Is there any way to perform Server-side event tracking?
Every call to my Firebase function, has to go through multiple steps. I couldn't monitor it through console logs. Actually I need to prepare ...
237
votes
12
answers
113k
views
How to add Google Analytics Tracking ID to GitHub Pages
Could be a simple question but I am full of doubts right now about adding Google Analytics Tracking ID to GitHub page.
I am using GitHub automatic page generator to create my GitHub page but it asks ...
176
votes
24
answers
73k
views
Is there a way to stop Google Analytics counting development work as hits?
I have added the JavaScript that I need to the bottom of my pages so that I can make use of Google Analytics. Only problem is that I am sure that it is counting all my development work as hits. Seeing ...
80
votes
3
answers
45k
views
307 Redirect when loading analytics.js in Chrome
I'm building a web app and using Google Analytics (analytics.js) for analytics. I recently noticed that analytics aren't working properly in Chrome.
I'm loading analytics using the standard code ...
76
votes
4
answers
87k
views
Google Analytics API - Get page view information for specific URLs
I am looking to implement a page view tracking system on one of my websites.
The website is a directory where suppliers can advertise their services. Suppliers have a unique profile page on the site, ...
64
votes
3
answers
53k
views
What is the client ID when sending tracking data to google analytics via the measurement protocol?
I want to use Google's new measurement protocol for sending tracking events from my server instead of JavaScript.
This page says the client ID is required:
https://developers.google.com/analytics/...
55
votes
9
answers
61k
views
google analytics - multiple trackers on one page (cookie conflict)
I'm writing a web application that's supposed to be embedded in other people's websites (kind of a widget). I'm using Google Analytics to track all the people that visit all instances of my script on ...
54
votes
5
answers
76k
views
ga or _gaq.push for Google Analytics event tracking?
I would like to track an onclick of a button on a page on a site, after a condition is passed checking if a cookie is present.
Very simple but which syntax would work best?
I have researched the ga ...
44
votes
8
answers
62k
views
'Token has been expired or revoked' - Google OAuth2 Refresh token gets expired in a few days
I am using Google Analytics API to fetch analytics data. I tried to authenticate it using following steps:
Created OAuth client ID in https://console.developers.google.com/ credentials section.
In ...
41
votes
10
answers
48k
views
Google Analytics 4 with React
I've been trying to use react-ga package with google analytics 4 in my app. The measurement id doesn't work with it and there is no tracking code in google analytics 4 I can use. Please, I need help!
...
32
votes
3
answers
28k
views
Using Google Analytics asynchronous code from external JS file
I'm trying to add the asynchronous version of the Google Analytics tracking code to a website.
I'd like to keep the JavaScript in a separate file, and call it from there.
Here's what I've currently ...
20
votes
2
answers
8k
views
Use multiple firebase accounts in single android app for google analytics
I have a use case in which 1 app will be used by multiple separate companies (franchises) that will have their own marketing and management teams. I need the user to select a franchise when the mobile ...