google-tag-manager

Extract part of URL with Google tag manager

不羁的心 提交于 2019-12-02 10:49:42
So i have this url " https://www.site.be/pand/titel-van-het-pand-t8500-17082-4 " and i have to extract the reference number at the back of the url. In this example "t8500-17082-4" with GTM to put into a custom dimension like this: var dimensionValue = 'REFERENCE_CODE_HERE'; ga('set', 'dimension1', dimensionValue); The reference codes at the eind of the url could start with either -t8... or t9... In GTM go to "Variables" -> "NEW" -> "Custom JavaScript" and type: function(){ var myRegexp = /(-t8|-t9)(.*)/g; //assuming you only ever have one "-t8"/"-t9" in the URL var result = document.URL.match

Android Google Tag Manager

喜欢而已 提交于 2019-12-02 04:27:01
I am implementing Google Tag Manager for Android Application V4 as requested by my Marketing team for future use,and I have never worked on GTM for websites so I am naive in this context. I have created account and Container and tags according to instructions on official site. I have linked tag manager with google analytics tracking id. I have written code in my application according to instructions on website and downloaded container to raw folder. When I run my app it gives me warning and verbose in logcat W/GoogleTagManager﹕ Resource is a UTF-8 encoded string but doesn't contain a JSON

Tracking custom IFRAME events in Google Tag Manager

眉间皱痕 提交于 2019-12-01 09:01:45
I have some IFRAMEs on my pages for external services -- AddThis, YouTube, and a JWPlayer-based custom video solution. I want to use GTM to track clicks and responses in those IFRAMEs (particularly 'play' events on the video) but the cross-domain policy prevents that. How do I make that work -- and how do I get it to work in GTM? It took me a while to figure it out, but basically: Create a GTM container and add the GTM codeblock to pages on your site. Create a ‘Tag’ to be your event listener. Create two ‘Triggers’: one for which pages to listen for the event, and one that fires when your event

Tracking custom IFRAME events in Google Tag Manager

和自甴很熟 提交于 2019-12-01 06:26:43
问题 I have some IFRAMEs on my pages for external services -- AddThis, YouTube, and a JWPlayer-based custom video solution. I want to use GTM to track clicks and responses in those IFRAMEs (particularly 'play' events on the video) but the cross-domain policy prevents that. How do I make that work -- and how do I get it to work in GTM? 回答1: It took me a while to figure it out, but basically: Create a GTM container and add the GTM codeblock to pages on your site. Create a ‘Tag’ to be your event

GTM randomly skips initial pageview in single page app

偶尔善良 提交于 2019-12-01 02:21:10
I have Pageview tag in Google Tag Manager that tracks SPA pageviews, identical to the one described in this guide . Basically it is Universal Analytics with linked Google Analytics ID that is triggered on History Change (at some point All Pages trigger was also added with no success). In my current app GTM skips Pageview tag on initial pageviews on all routes that don't have async resolvers. Usually the routes fire the tag sometimes (1 of 5 times), this may vary a bit depending on conditions (cached vs uncached, localhost vs production). On the routes that have resolvers with long durations (>

How to use Google Analytics and Google Tag Manager 2 on a local address?

…衆ロ難τιáo~ 提交于 2019-11-30 22:35:48
I'm relatively new to GTM and have been experimenting with the new interface which will be fully replacing the original on 1 April: https://support.google.com/tagmanager/answer/4605576 . However, I have encountered some issues getting Google Analytics to register pageviews when testing on a local address. There is a solution for this using the original GTM layout outlined here: Track localhost on Analytics in Google Tag Manager , so I don't wish to ask a duplicate question. However, in the new Google Tag Manager design there is no longer an option to set Cookie Domain to 'none', so how could I

Track localhost on Analytics in Google Tag Manager

佐手、 提交于 2019-11-30 13:46:19
I have a problem with tracking Google Analytics on localhost with Google Tag Manager. I can see on the API for Analytics ( https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#localhost ), all i need to do is to set cookieDomain to none. I do not find this option in Google Tag Manager. Does anyone know how to do this? The documentation referenced it is about the Universal Analytics (new GA API version). To solve this problem, you have two options: 1) Using the traditional tag "Google Analytics", in 'More settings' > 'Domains and Directories' > 'Domain Name': none 2

GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target

扶醉桌前 提交于 2019-11-30 04:38:56
问题 While trying to implement Google Tag Manager v5 in my Swift app, I faced the following warning, which caused me some troubles : GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target. It took me more time than it should have, and since the answer for my problem was pretty hard to find and was not on SO, I decided to create this Q&A, in case some people would be in the same situation as mine ! 回答1: First, make sure you're

_googWcmGet callback not working via GTM with dynamic phone number

别来无恙 提交于 2019-11-30 04:18:22
I'm trying to get Adwords Call Conversion tracking working on my site, using GTM. Everything is set up on the Adwords side (call extensions + call from website conversion) but the replace function still isn't working. <script type="text/javascript"> // the code from adwords, loads the _googWcmGet function (function(a,e,c,f,g,b,d){var h={ak:"XXXXXXX",cl:"XXXXXXXX"};a[c]=a[c]||function(){(a[c].q=a[c].q||[]).push(arguments)};a[f]||(a[f]=h.ak);b=e.createElement(g);b.async=1;b.src="//www.gstatic.com/wcm/loader.js";d=e.getElementsByTagName(g)[0];d.parentNode.insertBefore(b,d);a._googWcmGet=function

Failed to execute 'postMessage' on 'Window' GoogleTagManager

孤街醉人 提交于 2019-11-30 00:01:27
Recently, I get this postMessage couldn't be cloned error. It is happening on most of the latest browsers like Chrome 68, Firefox 61.0, IE11, Edge. Failed to execute 'postMessage' on 'Window': function (a){if(qe.$a.hasOwnProperty(a))return qe.$a[a]} could not be cloned. The stack trace is: Error: Failed to execute 'postMessage' on 'Window': function (a){if(qe.$a.hasOwnProperty(a))return qe.$a[a]} could not be cloned. at _reportEvent (eval at (:1:35637), :94:35) at eval (eval at (:1:35637), :55:5) at eval (eval at (:1:35637), :433:11) Searching through the source of my page in DevTools shows