Hi,
I am trying to get GA event tracking enabled in CFv6. In the forums I see the use of data-gvalidate_success but when implemented it doesnt track anything inside GA.
I use following JS in Javascript custom code block:
Then in form display section I added
data-gvalidate_success:ga_track_event
to the form tag attributes box
All code is loaded in front-end, just de ga_track_event function doesn't get fired.
Please help, regards,
Mark
I am trying to get GA event tracking enabled in CFv6. In the forums I see the use of data-gvalidate_success but when implemented it doesnt track anything inside GA.
I use following JS in Javascript custom code block:
function ga_track_event(event, form){
console.log('tracking fired');
ga('send', 'event', 'verzend-contact-formulier', '<?php echo $this->get("pagesection","home"); ?>', '<?php echo $this->get("parent-url","home"); ?>');
}
Then in form display section I added
data-gvalidate_success:ga_track_event
to the form tag attributes box
All code is loaded in front-end, just de ga_track_event function doesn't get fired.
Please help, regards,
Mark
Hello pinkeltje77,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I add Google Analytics event tracking in CFv5?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I add Google Analytics event tracking in CFv5?
P.S: I'm just an automated service😉
That does not help, I followed that but its not working.
Really no one can help me with this?
Hi pinkeltje77,
Apologies, I did not see this earlier!
Did you try just placing the code inside <script> and </script> tags inside a "Custom code" action in the form "submit" event ?
Best regards,
Max
Apologies, I did not see this earlier!
Did you try just placing the code inside <script> and </script> tags inside a "Custom code" action in the form "submit" event ?
Best regards,
Max
For the form itself, go to your setup tab and under "load" -> "Display section", under "Form tag attributes" you can put in
onSubmit:ga('send','event','contactForm','submitContactForm');
Obviously, replace contactForm and submitContactForm with whatever category and event name you want.
​
For buttons, under your Designer tab, go Advanced and put the code in the Extra Attributes field.
onClick:ga('send','event','contactForm','clear');
​
Please note the -> : <- separating the two parts of the attribute., as opposed to an equals sign.
​
I have just done this and verified that my event is correctly fired and sent to GA.
onSubmit:ga('send','event','contactForm','submitContactForm');
Obviously, replace contactForm and submitContactForm with whatever category and event name you want.
​
For buttons, under your Designer tab, go Advanced and put the code in the Extra Attributes field.
onClick:ga('send','event','contactForm','clear');
​
Please note the -> : <- separating the two parts of the attribute., as opposed to an equals sign.
​
I have just done this and verified that my event is correctly fired and sent to GA.
This topic is locked and no more replies can be posted.