Add an onClick Event to a Button Shortcode


It is not possible to add HTML code within a Shortcode. It is however possible to get the HTML Code for that Shortcode and use it to add the onClick Event code to.


  • Open the Shortcode Manager
  • Locate the desired Button Shortcode and insert it on a Page.
  • View that Page Source Code using your Browser and locate the HTML Code for the Button. It should look something like this:
    <a class="ka_button small_button small_alphagreen" href="http://">Content goes here…</a>
  • Or:
    <a target="_self" class="small autumn tt-button" href=""> Button Label </a>
  • Copy that Code and go back to the Page Editor and switch to the Text Editor.
  • Remove the inserted Shortcode and replace it with the copied HTML Code.
  • Then insert the onClick Event HTML Code within the a href=””
  • Example:
    <a class="ka_button small_button small_alphagreen" onclick="_gaq.push(['_trackEvent', 'litebutton', 'clicked', '']);" href="http://">Content goes here…</a>
  • Another example:
    <a class="ka_button small_button small_alphagreen" onclick="ga('send', 'event', ‘contact’, '000-000-000');" href="http://">Content goes here…</a>