Google Tracking Code to Button Help Needed

Hi there

I’ve been asked to add a Google tracking code to a submit form in my Foundry built site.

I’ve been given this -

onClick=“ga(‘send’, ‘event’, { eventCategory: ‘Contact Form’, eventAction: ‘Submit’, eventLabel: ‘Contact Page’});”

My button code currently looks like this:

<div class="text-xs-left">
		<input type="submit" id="fp-submit" name="fp-submit" class="btn custom btn-md  fb-submit-btn" value="Send">

Any ideas how I should add that? Cheers

There is not a way to append an onclick to the submit button for the Form.

Hi Adam - thanks - there’s no way of making that work? It’s a client request


No, sorry, that isn’t a possibility.

Check in with Joe Workman. His Call To Action stack can integrate with analytics/events. I’m not sure how it works myself but he may have a workaround.