AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.6K members online now
1.6K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Adding an Event tage to JS File

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

HI - Can anyone please tell me how to add this code:

onclick=ga('send', 'event', 'form-submit', 'click')

to the JS file to capture form fills on

:http://www.bestdentistboston.com/contact

Thank you!

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author J_Lynch_Googler
November 2015

Re: Adding an Event tage to JS File

Top Contributor
# 4
Top Contributor
Almost there!

<a onclick="ga('send', 'event', 'form-submit', 'click');" href="javascript&colon;void(0);" id="ctl01_aFormSubmit" class="btn btn-primary save pull-left" title="Submit">
Submit</a>
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

View solution in original post

Re: Adding an Event tage to JS File

[ Edited ]
Top Contributor
# 2
Top Contributor

That would be on the A tag containing the Submit label, for a final result of:

<a onclick="ga('send', 'event', 'form-submit', 'click');" href="javascript&colon;void(0);" id="ctl01_aFormSubmit" class="btn btn-primary save pull-left" title="Submit">
Submit</a>

I'm afraid the code snippet above got modified, replace "&colon;" with a colon (":") 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Adding an Event tage to JS File

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

Hi Julien

It should go from:

<a href="javascript&colon;void(0);" id="ctl01_aFormSubmit" class="btn btn-primary save pull-left" title="Submit">Submit</a>


To This:

<a onclick="ga('send', 'event', 'form-submit', 'click'):" href="javascript&colon;void(0);" id="ctl01_aFormSubmit" class="btn btn-primary save pull-left" title="Submit">
Submit</a>

Marked as Best Answer.
Solution
Accepted by topic author J_Lynch_Googler
November 2015

Re: Adding an Event tage to JS File

Top Contributor
# 4
Top Contributor
Almost there!

<a onclick="ga('send', 'event', 'form-submit', 'click');" href="javascript&colon;void(0);" id="ctl01_aFormSubmit" class="btn btn-primary save pull-left" title="Submit">
Submit</a>
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Adding an Event tage to JS File

Follower ✭ ☆ ☆
# 5
Follower ✭ ☆ ☆

Darn - Colons!!!!

THANK YOU!