All Questions
Tagged with google-tag-manager html
216 questions
4
votes
2
answers
88
views
What does && in javascript mean when used on html elements?
When updating Google Tag Manager to support CSP and nonce, they say to use this script:
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d....
0
votes
1
answer
49
views
Capitalize first character of GTM Data Layer Variable
I'm trying to capitalize the first character of a string from user input field. Below is the listener tag that collects the firstname data.
`<script>
(function () {
var element = document....
2
votes
1
answer
29
views
Pulling URL from Product Page with Attribute Selector?
Im attempting to implement schema markup via Google Tag Manager.
For example, one piece of code that would dynamically pull in unique urls from product pages.
In plain jane terms, it would be "if ...
1
vote
0
answers
44
views
GA4 + tracking checkbox value on submit
We have a checkout page that includes a checkbox for email signups. I need to be able to track the number of orders submitted with/without the checkbox checked as a means of verifying that the right ...
0
votes
0
answers
19
views
Share link preview on whatsapp contain google tag manager code [duplicate]
Code appears to WhatsApp share link
Does anyone know how to solve this? When I share a website link on WhatsApp, there is a code that includes on preview of the link on WhatsApp. Because it can ...
0
votes
1
answer
216
views
How to Connect "Custom HTML" Google Tag Manager Tag to Google Analytics (GA4) and Google Ads
Using a third party tool (Appointy.com) to manage appointment sign ups. Goal is to take this conversion data and use it for Google Ads and Google Analytics (GA4). Per Appointy support, the only way to ...
0
votes
0
answers
47
views
User Defined Variables for Cutsom HTML GTM Tags
I am trying to pull sales value from the data layer using a custom HTML tag. At the moment, I am using a pre-existing user defined variable that works on the client's Google Ads and Meta Ads tags, ...
-1
votes
1
answer
254
views
Need to capture a DOM variable in GTM but the ID is dynamic and changes based on user
Need to return phone number in a form field as a variable in GTM, but the id is dynamic and is not being pushed to the datalayer. Wanting to pull out required value below.
<input name="phone&...
0
votes
0
answers
82
views
I need to get the alt attribute of the clicked image element. The alt value of multiple images on click. How to do in tag manager JavaScript?
This is the exact code that i'm using currently.
function () {
if (document.querySelector("#wrapper > section.panel.spacer--banner.bg--banner.flex-column.first > div > div > div....
0
votes
0
answers
232
views
Triggering GTM Event Based on URL Change in Main Page Caused by Click Inside an Iframe
I am working on a web project where I have an iframe embedded in my main page (hosted on cba123.com). Within this iframe, there are links that, when clicked, change the URL of the main page to a ...
0
votes
1
answer
91
views
Preventing a Popup from Reappearing in the Same Session Using Google Tag Manager (JavaScript)
In Google Tag Manager, I've created a script containing a popup that is displayed under certain conditions. Specifically, I have two associated triggers that launch the script:
after a 30-second ...
0
votes
2
answers
101
views
Parse data within script tag in HTML using JavaScript
Trying to parse some data that is included within a tag in the HTML using JavaScript. Specifically I'd like to retrieve the value for 'email' as in the script below, with the expected output being &...
0
votes
2
answers
502
views
Google Tag Manager not appearing in page source
I am using Astro framework for building static pages. I got a task to add a google tag right under the opening head tag and the second one immediately after opening the body tag, which I have done (...
0
votes
1
answer
721
views
GA4: Is it risky if I add a parameter to 'page_view' event? [closed]
I want to track some metrics of my webpages (such as the "Average Engagement Time" or the clicks on the ads), switching from one web design to another, by creating a custom dimension in GA4.
...
1
vote
1
answer
99
views
Change elements in HTML via Javascript, implemented via GTM
We are currently trying out a few new options within our CMS. But before we contact the developers to permanently make the changes to the templates, we would like to try out a few possibilities. To do ...