Tagged: onclick event
i would like to add this onclick=”return gtag_report_conversion(‘https://sysop.com.mx/desarrollo-web-y-de-aplicaciones/’)” to the submit button, how can i do it?
Hey sysop2018,
Thank you for the link to your site, try adding this code to the end of your functions.php file in Appearance ▸ Editor:
function add_gtag_to_contact_submit() { ?>
<script>
(function($) {
$('#top.page-id-1607 .contact-landing .button[type=submit]').attr('onclick', 'return gtag_report_conversion(\'https://sysop.com.mx/desarrollo-web-y-de-aplicaciones/\')\;');
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_gtag_to_contact_submit');
Best regards,
Mike
Dear Support,
Is it not possible to improve buttons, contact forms, menu points etc. with an advanced field or something else for such stuff instead of manipulating manual the functions?
To make it easier to work with Google Analytics and Tag Managers?
Best
S.