Google Analytics

Options
We have a marketing group that is pushing people to one of my school's NetCommunity pages.  They sent me an email asking me to "please place the below 'on click code' on the Apply now button across your site.  This onclick code will allow us to track how many times the “Apply” button was clicked on the site"

 

onClick="ga('send', 'event', ‘SWC’, ‘Click’, ‘Apply’),”


​I do have the general Google Analytics code already part of our site administration, and I receive general analytic data just fine for the past number of years.  However, this recent request to put OnClick code specifically on a button is new to me.  Any ideas of what I need to do?


Many thanks!


​Geoffrey Goodfellow
Tagged:

Comments

  • Geoffrey Goodfellow:

    We have a marketing group that is pushing people to one of my school's NetCommunity pages.  They sent me an email asking me to "please place the below 'on click code' on the Apply now button across your site.  This onclick code will allow us to track how many times the “Apply” button was clicked on the site"

     

    onClick="ga('send', 'event', ‘SWC’, ‘Click’, ‘Apply’),”


    ​I do have the general Google Analytics code already part of our site administration, and I receive general analytic data just fine for the past number of years.  However, this recent request to put OnClick code specifically on a button is new to me.  Any ideas of what I need to do?


    Many thanks!


    ​Geoffrey Goodfellow

     

    Hi Geoffrey,

    Typically that type of code is added to the link, in this case the apply button. Here's a sample of what I think they're asking of you: <a href="www.applybuttonURL" onClick="ga('send', 'event', ‘SWC’, ‘Click’, ‘Apply’),”> Apply </a>


    You'll add it after the href link & before the closing carrot that comes before the link wording. Give it a shot & let me know if that works.

  • Thanks so much, Rebecca!  This is exactly the kind of detailed help I needed.  I inserted after the href code as you indicated, and it seems to be working!  Many thanks.  Much appreciated!
  • Yahoo! Glad it's working!

Categories