Replies: 0
I need to add some google conversion tracking code to the site and need to add “onclick=”return gtag_report_conversion(‘http://example.com/your-link’);” to the submit button for one of my forms, but I’m not sure of the correct way to this.
Obviously the normal button would be:
[submit class:medium class:blue class:btn class:icon-left class:icon-left-open-big class:submit "Send Details"]
So I replaced this with, so I can actually add the onclick code:
<input type="submit" value="Send Details" class="cuco wpcf7-form-control wpcf7-submit medium blue btn icon-left icon-left-open-big submit" disabled="" onclick="return gtag_report_conversion('http://example.com/your-link');" >
<span class="ajax-loader"></span>
But the problemwith doing it this way is that the button redirect the visitor before the contact forms content is sent.
Does anyone know how this should be done correctly?