google callback on a button

Attach a Google Analytics callback to a CF button without code corruption.

Overview

The issue occurs because special characters in the onclick event attribute are being incorrectly encoded by the form builder.
Reformat the callback directly in the event field without using quotes around the attribute, and ensure any trailing double quotes are removed.

Answered
ChronoForms v6
Mi Minnie Mouse 12 Nov, 2018
Hi, I need to attach thefollowing google callback to a button. i added it as advanced>event
onclick="return gtag_report_conversion(‘http://www.xxx.com/images/files/web.pdf')"
but when i view the page source it looks like this:
<button onclick="return gtag_report_conversion(‘http="//www.xx.com/images/files/web.pdf')&quot;" data-events="[]" class="ui button blue uk-button uk-button-large fluid" type="submit" name="Submit" id="send" value="" >
any ideas about why its doing this? google is coming up empty on it even though it does correctly redirect to the pdf for the user...
Mi Minnie Mouse 12 Nov, 2018
Answer
1 Likes
okay I found another thread finally that explains it. you need to reformat the call. dont forget to remove the double quote at the end too...
onclick:call to function here
This topic is locked and no more replies can be posted.