Google Analytics tracking code giving CORS error

I'm using (what looks to me like) new Google Analytics tracking code that I got from my account yesterday. It makes use of some "Global site tag". I've placed it at the top of my , as GA...

Track custom events on GA inserted by GTM

I have inserted Google Analytics using Google Tag Manager on my site. Often, an site has only one analytics. But when you have multiple, analytics recommends to name them. Custom Events using...

Track multiple events with Global Site Tag

Is it possible with Global Site Tag to track multiple events in a single http request? For example, the following codes generates 3 calls to the google tracking server, if possible i would like to...

Convert Google Analytics.js to gtag.js?

I want to convert my current Google Analytics tracking code to use the newer gtag.js (Global Site Tag) What syntax is needed replace the below values with values that will work with the newer...

Google Analytics not Tracking FB Instant Articles Page Views.

Instant Articles are configured a couple of months back. We have close to 300+ articles. Everything is working fine as long as Instant Articles is concerned. I was not aware of the fact that GA...

The Google Optimize snippet for the container with ID GTM-... is not correctly installed on this page

I'm trying to use Google Optimise with Analytics installed by gtag.js and am getting errors in some parts of the Optimise UI but not others. Here's what I've done: Installed Google Analytics...

Google analytics tracking js code not working in React

I have a react website and in my html template I put the google analytics tracking code snippet. The tracking works on my local (so I can actually see my dev session in GA console) but it doesn't...

How to Mask IP addresses and Force HTTPS with Google Global Site Tag gtag.js?

How to Mask IP addresses and Force HTTPS with Google Global Site Tag gtag.js ? In the old tracking code this is done with: ga('set', 'forceSSL', true) //force https ga('set', 'anonymizeIp', true)...

Which tracking code am I supposed to use? The one with window.dataLayer or window.ga?

I've just started using GA (after I took a long vacation from it). It seems I'm missing something obvious/simple here. I don't understand why in my analytics account / admin / property / tracking...

"unreachable code after return statement" error in Google Analytics JS code on Firefox - is this my fault?

I'm using the current Google Analytics tracking code, and on Firefox 59 I get this error in console: unreachable code after return statement On this javascript:...

How can I combine Google's Global Site Tag with Subresource Integrity?

I'm implementing global tracking on my site following the steps described by Google. But I want to also keep my Subresource Integrity (SRI) up to date. So I ran the following command to find the...

Injecting Google Analytics Tracking Snippet into Websites Behind Nginx Reverse Proxy

I've been wanting to use Google Analytics for a while now and I want to avoid inserting the tracking snippet manually into each webpage. Furthermore, it might not even be supported to do so with...

Cross Domain Tracking with Global Site Tag - What goes where?

Having some issues with the implementation of cross domain tracking with the Gtag.js. I'm trying to do CDT for a restaurant website which has an external booking system with a 5 different URLs (1...

Using Google Analytics Global Site Tag in PHP file rather than HTML

I am trying to implement google analytics to a website composed of PHP files rather than HTML. Can I still use the Global Site Tag simply by adding a head element and pasting the code into the PHP...

Multiple installations of Global site tag (gtag.js) detected in Gatsby application

I have Google Analytics code set up in my gatsby application. <script> var gaId = "UA-xxxxxxxx-1"; var JSLink = "https://www.googletagmanager.com/gtag/js?id=" + gaId; var JSElement =...

Angular: Dynamically loading Google Analytics?

I'm using Google Analytics Global site tag (gtag.js) However, I can't directly insert the tag in index.html because the trackingID is dynamically loaded over network, so I need to wait to get the...

Google Optimize not triggering when running on localhost

I am trying to get Google Optimize experiment data in JavaScript, by following these instructions. But I get no callback and I can't see anything happening in the debugger either. The linked...

Do I need the Global Site Tag (gtag.js) for optimal use with Adwords, if I'm already using Google Tag Manager to pull in Google Analytics?

I'm fairly new to Google Tag Manager and handling Google Analytics along with Adwords. I received a request to add a few event trigger scripts for Adwords and I set them up in Google Tag Manager,...

Dynamically change the <script> tag src

Dynamically change the src tag I am integrating Google analytics into my Angular app. It requires to add a google tracking id in the script-src and later. It needs to load at first before anything...

How can I use google analytics without Global Site Tag?

I'm building web-based crypto wallet and I want to track very basic info, such as wallet get created event. However I don't want to use Tracking code, Global Site Tag (gtag.js). Is there any way...

history.pushState seems to cause gtag.js to load again (SPA)

My SPA was re-loading GTAG every time I changed pages. Every post online was saying I have to be causing GTAG to load again in my code. So, I put together a small rough sample to re-create the...

Google Analytics blocked in IFrame due to "SameSite" & "Secure" setting of cookies

We're running a service on our-site.com. Our customers can either use the service "stand alone" by simply linking from their-site.com to our-site.com/customer-service or by embedding our service...

Google Tag Manager being loaded multiple times

I have this configuration for Google Analytics wherein I load 2 products in the site's header as such: <script> window.dataLayer = window.dataLayer || []; function...

How to set up conversion tracking for hotel campaigns using Google Tag Manager (instead of gtag.js)?

Unfortunately, built in GTM tag "Google Ads Conversion Tracking" doesn't support setting special Hotel properties (used in Google Hotel Ads): 'items': [{ 'id': 'PARTNER_HOTEL_ID', ...

How to set "secure" attribute of the cookies used by Google Analytics Global Site Tag (gtag.js)?

I'm using Google Analytics Global Site Tag (gtag.js) tracking code on my Github Pages. The following tracking code is copy-and-pasted as the first item into the <HEAD> of every webpage I want to...

Is it as simple as adding onclick=”ga(‘send’, ‘event’, ‘Category’, ‘Action’, ‘Label’, ‘Value’);” to my links in order to track click events?

I want to track outbound link clicks on my site. I have Google Analytics on my site in terms of having the global site tag (gtag) in the head. I'm happy to add the onClick event to each link as...

I am trying to add Google Analytics tracking to my public Github Page, but I am worried about privacy

I have a domain from GoDaddy that I changed the DNS settings for and redirected to a public Github Page of mine. I just signed up for Google Analytics tracking, but it's telling me to put the...

Prevent gtag / global site tag from tracking initial page load

We have a single page application using Gtag (Global Site Tag), and we manage the tracking of pages manually to provide the correct page names that we want to track. So we call gtag('config',...

How to set an Google Opt Out Cookie FOR GOOGLE ANALYTICS 4 - not universal one - the new ga4

For a new project I want to use Google Analytics 4. Until today I was using the normal Google Analytics and on my privay policy page I have had an Google Opt Out Cookie. This was implement by an...

How to solve the Conversion Tag Error : net::ERR_ABORTED

I'm using Google Tag Manager to set a Google Ads conversion tag in my website. When I was debugging using the Tag Assistant window from GTM, my conversion tag was fired successful. When I opened...