SEE DOC https://gist.github.com/kolbaba/5c9b112ffc3db9e4b3648eae8b655f11
<script>
document.querySelectorAll('form')[0].classList.add('pnt')
</script>
<script>
document.getElementById('form').classList.add('pnt')
</script>
<script>
document.getElementsByClassName('form')[0].classList.add('pnt')
</script>
<script>
document.getElementsByTagName("element")[0].classList.add('pnt');
</script>
<script>
document.getElementById('form_id').classList.add('pnt')
</script>
<script>
document.querySelector('firstElement')[0].classList.add('pnt')
</script>
<script>
document.querySelectorAll('allElementsOfType')[0].classList.add('pnt')
</script>
<script>
document.querySelectorAll('form')[3].classList.add('pnt')
</script>
<script>
var forms = document.querySelectorAll('form')
for (var i = 0; i < forms.length; i++) {
forms[i].classList.add('pnt')
}
</script>
selector: [‘.form-class’]
This is used when you're trying to target a form to add pnt. Use this when other methods of adding pnt are not working.
leads.pollForForm(‘.late-form’) This is used when the form is not sending data or tracking is not working. You need to target the form's id or class for this to work. Think of this as a loop.
leads.submitOn(‘click’, ‘a.link-submit’) Use this when form-inquiry isn't being passed or if the submit button is not a standard one. Simply target the submit button, replace a.link-submit to class or id of submit button.
ignoreFields If you want to ignore fields such as password or other personal information
Open incognito browser Open dev pane > network tab > check preserve log Visit page > Network tab > see 2x “visit” entries Go to page with form Application tab > Local storage > site.com Type into forms and notice lead_ keys show up with your data in value column Go back to network tab > submit form > see 2x “form-inquiry” go through
Example: https://www.illinoissafety.com/ Setup tracking for “SIGN UP” link in NAV and content When clicked submit event
To test this:
(Testing in Firefox right now) Load the page and open devpane Target the link in the inspector pane Open network pane Click the link See "200 - collect?v=...." Click the collect file and see in the right pane “Params” (Based on the category/action/ etc…): T: event ec: “Sign Up Via Click” Ea: Sign up for class
$( "form" ).addClass( "pnt" );
jQuery( "form" ).addClass( "pnt" );
pntjQuery( "form" ).addClass( "pnt" );
document.getElementsByClassName('form')[0].classList.add('pnt');
<script>
jQuery(function(){
(function loop() {
setTimeout(function () {
var f = jQuery('form');
if (f[0]) {
f.addClass('pnt');
} else {
loop();
}
}, 250);
}());
});
</script>
<script>
$(function() {
var loop = setInterval(function () {
var $form = $('form')
if ($form.length) {
$form.addClass('pnt')
clearInterval(loop)
}
}, 250);
});
</script>