Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
6 views
Gecko GTMScript ECMA5 Updated
Uploaded by
Venkey Dematti
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download now
Download
Save GeckoGTMScriptECMA5Updated For Later
Download
Save
Save GeckoGTMScriptECMA5Updated For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
6 views
Gecko GTMScript ECMA5 Updated
Uploaded by
Venkey Dematti
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download now
Download
Save GeckoGTMScriptECMA5Updated For Later
Carousel Previous
Carousel Next
Save
Save GeckoGTMScriptECMA5Updated For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 2
Search
Fullscreen
// Code to handle input type text and tel
var inputs = document.querySelectorAll("input");
if (inputs.length > 0) {
Array.prototype.forEach.call(inputs, function (input) {
input.addEventListener("keyup", function (v) {
var elementType, placeHolder, fieldId , autoComplete, type;
autoComplete = input.getAttribute("autocomplete");
type = input.getAttribute("type");
if ((type === "text" || type === "tel") && event.target.value.length >= 2
&& !input.getAttribute("data-triggered")) {
fieldId = input.id;
if (input.getAttribute("role") == 'searchbox') {
elementType = 'select';
fieldId = input.getAttribute("aria-labelledby");
placeHolder = document.getElementById(fieldId).textContent.trim();
}
if(autoComplete === "email") {
elementType = "text";
placeHolder = "Email Address";
} else if(autoComplete === "tel") {
elementType = "tel";
placeHolder = "Telephone Number";
} else {
placeHolder = input.getAttribute("placeholder");
}
window.triggerGtmEvent('gecko-blur-on-input', {
field_id: fieldId,
field_placeholder: placeHolder,
field_type: elementType || type
});
input.setAttribute("data-triggered", true);
}
});
});
}
// Code to handle radio inputs
var radios = document.querySelectorAll("input[type='radio']");
if (radios.length > 0) {
Array.prototype.forEach.call(radios, function (radio) {
radio.addEventListener("change", function () {
var eleName, eleType, eleLabel, elePlaceholder;
if (!radio.getAttribute("data-triggered")) {
eleType = "radio";
eleName = radio.getAttribute("name");
eleLabel = document.querySelector('label[for="' + eleName + '"]');
var getAllRadios = document.querySelectorAll('input[name="' + eleName +
'"]');
if (getAllRadios.length > 0) {
Array.prototype.forEach.call(getAllRadios, function (getAllRadios) {
getAllRadios.setAttribute("data-triggered", true);
});
}
elePlaceholder = eleLabel ? eleLabel.textContent.trim() : "";
window.triggerGtmEvent('gecko-blur-on-input', {
field_id: eleType,
field_placeholder: elePlaceholder,
field_type: eleType
});
radio.setAttribute("data-triggered", true); //Mark the radio as triggred
}
});
});
}
// Code to handle select element
var chosenContainers = document.querySelectorAll(".chosen-container");
if (chosenContainers) {
Array.prototype.forEach.call(chosenContainers, function (select) {
//Store inital span content
var initialContent = select.querySelector('.chosen-single span').textContent;
select.addEventListener("click", function () {
if (!select.dataset.gtmTriggered) {
var spanContent = select.querySelector('.chosen-single span').textContent;
if (spanContent !== initialContent) {
var clickedId = select.id;
// Remove "_container"
var originalId = clickedId.replace("_container", "");
// Find the label value, using for attribute
var fieldLabelElement = document.querySelector('label[for="' + originalId
+ '"]');
// Check if the label element exists before accessing innerHTML
var fieldLabel = fieldLabelElement ? fieldLabelElement.textContent.trim()
: "";
var selectId = originalId;
var selectName = fieldLabel;
var selectType = "select";
// Trigger GTM event
window.triggerGtmEvent('gecko-blur-on-input', {
field_id: originalId,
field_placeholder: fieldLabel,
field_type: selectType
});
select.dataset.gtmTriggered = true;
initialContent = spanContent; //To treating it as the new "initial"
content for future comparisons.
}
}
});
});
}
You might also like
Bot V5
PDF
100% (3)
Bot V5
7 pages
Script Calendrier
PDF
100% (2)
Script Calendrier
7 pages
Script Image
PDF
100% (5)
Script Image
5 pages
BOT Nabster29
PDF
No ratings yet
BOT Nabster29
7 pages
Sample ITK Code, Item and Dataset
PDF
No ratings yet
Sample ITK Code, Item and Dataset
7 pages
Sample Custom Keywords in Katalon Studio
PDF
No ratings yet
Sample Custom Keywords in Katalon Studio
5 pages
Namespace Registration
PDF
No ratings yet
Namespace Registration
6 pages
Rain Alert 999dice For Tampermonkey
PDF
100% (1)
Rain Alert 999dice For Tampermonkey
7 pages
index
PDF
No ratings yet
index
7 pages
chk1
PDF
No ratings yet
chk1
176 pages
Stockyard Select
PDF
No ratings yet
Stockyard Select
2 pages
Bootstrap Bundle
PDF
No ratings yet
Bootstrap Bundle
122 pages
Bram Keren
PDF
No ratings yet
Bram Keren
17 pages
Ajax
PDF
No ratings yet
Ajax
3 pages
bot calendrier V5
PDF
No ratings yet
bot calendrier V5
7 pages
Util Hammer
PDF
No ratings yet
Util Hammer
47 pages
Script TG
PDF
No ratings yet
Script TG
4 pages
new patch for template document 1
PDF
No ratings yet
new patch for template document 1
6 pages
dataentryform
PDF
No ratings yet
dataentryform
4 pages
async function (1)
PDF
No ratings yet
async function (1)
3 pages
sidebar_12232
PDF
No ratings yet
sidebar_12232
18 pages
Lab 17
PDF
No ratings yet
Lab 17
9 pages
New 6
PDF
No ratings yet
New 6
29 pages
Bootstrap Bundle
PDF
No ratings yet
Bootstrap Bundle
114 pages
FRE
PDF
No ratings yet
FRE
5 pages
code.gs_gmail
PDF
No ratings yet
code.gs_gmail
3 pages
Backup of UAT 3 Processor on 20 Oct 2023
PDF
No ratings yet
Backup of UAT 3 Processor on 20 Oct 2023
9 pages
Bakery
PDF
No ratings yet
Bakery
30 pages
Aplicatie Client-Server
PDF
No ratings yet
Aplicatie Client-Server
10 pages
calandrier
PDF
No ratings yet
calandrier
5 pages
Bootstrap
PDF
No ratings yet
Bootstrap
81 pages
Summary To Receipt
PDF
No ratings yet
Summary To Receipt
11 pages
Complete Source Code
PDF
No ratings yet
Complete Source Code
44 pages
Namespace REPUESTO
PDF
No ratings yet
Namespace REPUESTO
26 pages
9 - 10 Program Penjualan
PDF
No ratings yet
9 - 10 Program Penjualan
7 pages
Public Class Invoice Extends Javax - Swing.Jframe: Form:Invoice STR "Insert Into Invoice Values (" +
PDF
No ratings yet
Public Class Invoice Extends Javax - Swing.Jframe: Form:Invoice STR "Insert Into Invoice Values (" +
5 pages
ProdPlan Route
PDF
No ratings yet
ProdPlan Route
16 pages
Pos
PDF
No ratings yet
Pos
15 pages
Ext
PDF
No ratings yet
Ext
12 pages
C# Database Lab Manual PDF
PDF
No ratings yet
C# Database Lab Manual PDF
72 pages
Ejemplo
PDF
No ratings yet
Ejemplo
18 pages
Yu Cheats Bot Nitro Type
PDF
No ratings yet
Yu Cheats Bot Nitro Type
32 pages
Otds Token
PDF
No ratings yet
Otds Token
3 pages
Default Eventargs: Namespace Public Partial Class Protected Void Object False False
PDF
No ratings yet
Default Eventargs: Namespace Public Partial Class Protected Void Object False False
2 pages
Java
PDF
No ratings yet
Java
16 pages
Membuat Form Nota - Pop Up Pelanggan
PDF
No ratings yet
Membuat Form Nota - Pop Up Pelanggan
8 pages
HTM 2 Asc
PDF
No ratings yet
HTM 2 Asc
4 pages
Change
PDF
No ratings yet
Change
88 pages
Common Question ITK Algorithm and Code
PDF
No ratings yet
Common Question ITK Algorithm and Code
12 pages
Editing the payload for crewcalendar UAT PROCESSOR BACKUP on 9 oct 2023
PDF
No ratings yet
Editing the payload for crewcalendar UAT PROCESSOR BACKUP on 9 oct 2023
4 pages
Scriccpt
PDF
No ratings yet
Scriccpt
4 pages
public String Cedularuc (Get Set )
PDF
No ratings yet
public String Cedularuc (Get Set )
2 pages
Shared Preferences Web - Dart
PDF
No ratings yet
Shared Preferences Web - Dart
2 pages
Jquery Jcryption 3 1 0
PDF
No ratings yet
Jquery Jcryption 3 1 0
82 pages
React Development
PDF
No ratings yet
React Development
60 pages
Tls Scrpte 1
PDF
0% (1)
Tls Scrpte 1
3 pages
form1(calculator)
PDF
No ratings yet
form1(calculator)
5 pages
NgRx SignalStore: An effortless solution for state management
From Everand
NgRx SignalStore: An effortless solution for state management
Abdelfattah Ragab
No ratings yet
How to a Developers Guide to 4k: Developer edition, #3
From Everand
How to a Developers Guide to 4k: Developer edition, #3
Xinc Cyberwizard
No ratings yet
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet
Night Vision Goggles
PDF
No ratings yet
Night Vision Goggles
2 pages
Andritz - 22 Pumped Storage Data PDF
PDF
No ratings yet
Andritz - 22 Pumped Storage Data PDF
2 pages
Ditila Wireless Telephone Motorola 720
PDF
No ratings yet
Ditila Wireless Telephone Motorola 720
108 pages
Astm F400
PDF
No ratings yet
Astm F400
12 pages
Service Report: Delhi Tech Solutions
PDF
No ratings yet
Service Report: Delhi Tech Solutions
1 page
What Is Business Architecture
PDF
No ratings yet
What Is Business Architecture
4 pages
Thermoeconomic Analysis of Gas Turbine Based Cycles: A. F. Massardo
PDF
No ratings yet
Thermoeconomic Analysis of Gas Turbine Based Cycles: A. F. Massardo
8 pages
Sandvine Solutions
PDF
No ratings yet
Sandvine Solutions
80 pages
Hashira Sac
PDF
No ratings yet
Hashira Sac
14 pages
Philmac Valve Technical Manual - Ball Valves
PDF
No ratings yet
Philmac Valve Technical Manual - Ball Valves
6 pages
420 00249 05 PV1100 Plus T1.5
PDF
No ratings yet
420 00249 05 PV1100 Plus T1.5
8 pages
Hotel Reservations British English Student Ver2
PDF
No ratings yet
Hotel Reservations British English Student Ver2
4 pages
Programmable Logic Controllers: Frank D. Petruzella
PDF
No ratings yet
Programmable Logic Controllers: Frank D. Petruzella
67 pages
A Review of Literature On E-Learning Systems in Higher Education
PDF
No ratings yet
A Review of Literature On E-Learning Systems in Higher Education
9 pages
Program To Calculate Sum
PDF
No ratings yet
Program To Calculate Sum
10 pages
Supertex Merchandising Co.,Ltd 9566 Alliance Audit Report Ear 4508 April...
PDF
No ratings yet
Supertex Merchandising Co.,Ltd 9566 Alliance Audit Report Ear 4508 April...
29 pages
Brakes Stuffer BDR 10-9-14
PDF
No ratings yet
Brakes Stuffer BDR 10-9-14
16 pages
"Automated Water Cooler Using Arduino": of Minor Project On Bachelor of Technology in
PDF
No ratings yet
"Automated Water Cooler Using Arduino": of Minor Project On Bachelor of Technology in
42 pages
Bioscrypt 4G V-Station Extreme En-7
PDF
No ratings yet
Bioscrypt 4G V-Station Extreme En-7
2 pages
Combustible Cartridge Cases: Cccs For Tank, Mortar and Artillery Systems
PDF
No ratings yet
Combustible Cartridge Cases: Cccs For Tank, Mortar and Artillery Systems
2 pages
IBB Catalogue
PDF
No ratings yet
IBB Catalogue
12 pages
RCV Control Solenoid Valve, BOV Control Solenoid
PDF
No ratings yet
RCV Control Solenoid Valve, BOV Control Solenoid
16 pages
802SC
PDF
No ratings yet
802SC
16 pages
Corolla Altis Brochure
PDF
No ratings yet
Corolla Altis Brochure
2 pages
Abb Actuador Up
PDF
No ratings yet
Abb Actuador Up
247 pages
Gilson Catalog 2020
PDF
No ratings yet
Gilson Catalog 2020
338 pages
Banlaw ReFuelling AUS Series Tank Vent PDS
PDF
No ratings yet
Banlaw ReFuelling AUS Series Tank Vent PDS
6 pages
Digital Communications Lab Mannual
PDF
No ratings yet
Digital Communications Lab Mannual
74 pages
PMT Log Books - Health Center - A4
PDF
No ratings yet
PMT Log Books - Health Center - A4
11 pages
Post Q Graphs
PDF
No ratings yet
Post Q Graphs
6 pages