Skip to content

Instantly share code, notes, and snippets.

@swsalim
Last active June 20, 2020 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swsalim/5583b5e3e065b3ffe2e81cc719a1306b to your computer and use it in GitHub Desktop.
Save swsalim/5583b5e3e065b3ffe2e81cc719a1306b to your computer and use it in GitHub Desktop.
BEFORE:
<input type="submit" value="Send Message" class="wpcf7-form-control wpcf7-submit btn btn-accent">
AFTER:
<!-- Google Analytics -->
<input type="submit" value="Send Message" class="wpcf7-form-control wpcf7-submit btn btn-accent" onclick="ga('send', 'event', 'Form', 'Click', 'Contact Us Form', '0');">
<!-- Or -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<input type="submit" value="Send Message" class="wpcf7-form-control wpcf7-submit btn btn-accent" onclick="gtag('event', 'Click', { 'event_category' : 'Form', 'event_label' : 'Contact Us Form', 'value': '0' });">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment