moved GA Client ID code to JS custom GTM variable
This commit is contained in:
parent
0e0ffda70b
commit
daea4892ad
@ -5,14 +5,6 @@
|
||||
autoFillLocation = document.querySelector("form[id^='mktoForm_']"), // will only find first Marketo form on a page
|
||||
firstRow = document.querySelector('form .mktoFormRow'),
|
||||
hiddenLinkedInInputs = document.createDocumentFragment(), // since we're creating multiple nodes, just do the add once
|
||||
clientID = (function () {
|
||||
try {
|
||||
var tracker = ga.getAll()[0];
|
||||
return tracker.get('clientId'); // GA/GTM will do this same thing in customTask - see GTM customTask variable
|
||||
} catch (e) {
|
||||
return 'n/a';
|
||||
}
|
||||
})(),
|
||||
hiddenInputCreator = function (tagName, onChangeHandler) {
|
||||
var newInput = document.createElement('input');
|
||||
newInput.style.position = 'absolute';
|
||||
@ -321,7 +313,7 @@
|
||||
values.Country,
|
||||
values.Title,
|
||||
'{{Page Path}}',
|
||||
'gclid:' + clientID,
|
||||
'gclid:' + '{{JS - GA Client ID}}',
|
||||
].join(' | '),
|
||||
};
|
||||
console.log(eventData);
|
||||
|
Loading…
Reference in New Issue
Block a user