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
2K members online now
2K 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

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello Everyone! can someone please help me? I am trying to add some GA code to a button - it seems that I am missing something - I am not tracking events. Can you please take a peak? Any edits I can try?

 

<div style="text-align: center;">
<button style="background:none;" onclick="window.open('https://app.evisit.com/ng/#/enroll/utidoctors','_blank')" target="_blank"><img width="200" height="38" src="http://utidoctors.com/wp-content/uploads/2017/05/visit22.png" class="vc_single_image-img attachment-full" onClick="ga('send', 'event', { eventCategory: 'Evisit Button', eventAction: 'clicked'});" alt="Request an eVisit >>"></button>
</div>

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Bronwyn V (Top Contributor)
July 2017

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 14
Visitor ✭ ✭ ✭

I got off the phone with Google - it's working now - we hard coded it in the footer:

<script>
window.addEventListener('load',function(){
jQuery('[href="https://app.evisit.com/ng/#/enroll/utidoctors"],[src="http://utidoctors.com/wp-content/uploads/2017/...(){
_gaq.push(['_trackEvent', 'button', 'clicked','e-visit'])
})
})
</script>

 

THANKS FOR ALL YOUR HELP AND EFFORTS IT IS SO APPRECIATED 

View solution in original post

Hello With GA Push Event tracking set up -

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi @Phillip D :-)

 

The following edited code worked for me when i tested it on my dev setup

<div style="text-align: center;">
<button style="background:none;" onclick="window.open('https://app.evisit.com/ng/#/enroll/utidoctors','_blank');ga('send', 'event', 'Evisit Button', 'clicked');">
<img width="200" height="38" src="http://utidoctors.com/wp-content/uploads/2017/05/visit22.png" class="vc_single_image-img attachment-full" alt="Request an eVisit" /></button>
</div>
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Let me check it out - thanks! 

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

It's still not tracking - ummm!

 

Event conditions

Set one or more conditions. A conversion will be counted if all of the conditions you set are true when an Event is triggered. You must have at least one Event set up to create this type of Goal. Learn more

Category Evisit Button
Action clicked
Label
Value

 

Goal description
Name
Evisit Site Visit Goal ID 1 / Goal Set 1
Type





Measure the most engaged visits to your website and automatically turn those visits into Goals. Then use those Goals to improve your AdWords bidding. Learn moreX

Hello With GA Push Event tracking set up -

[ Edited ]
Top Contributor
# 5
Top Contributor

Hi @Phillip D :-)

 

1) Did you copy/past the code i gave you or make changes to your own code? 
If you made changes to your own code, try copy/pasting the code i gave you

(there are typos/code errors in the code you gave in your initial post)

 

How are you testing it?

2) Are any filters applied to the View in GA, that may be preventing your hits from being tracked?


3) Are you checking the GA Real Time reports for the event and conversion?
(real time reports can take up to 2hrs to reflect changes in GA configuration/setup)

eta.. keep in mind a conversion can only occur once during the same session. So if it's fired a conversion once, 

before retesting either 30mins of inactivity or after you leave the site will have to lapse to end the session.. or you will need to clear your cache and cookies to end the current session in order to retest)

 

4) Are you using a mobile device or desktop to test the button clicks? If using a mobile, sometimes the hits will not show in real time reports as mobile devices often batch hits to conserve battery power. They will however be tracked as normal in the Standard Reports (which can take 4-48hrs)\

 

Are you able to provide a link to the page that has the button on it?

Thanks

Bronwyn

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hello Bronwyn - thank you so much for your continued help! Still not tracking after several days. I did copy and paste your code see below. Something is still wrong? Shouldn't the goal track every-time the Burton is clicked?

 

<div style="text-align: center;">
<button style="background:none;" onclick="window.open('https://app.evisit.com/ng/#/enroll/utidoctors','_blank');ga('send', 'event', 'Evisit Button', 'clicked');">
<img width="200" height="38" src="http://utidoctors.com/wp-content/uploads/2017/05/visit22.png" class="vc_single_image-img attachment-full" alt="Request an eVisit" /></button>
</div>

Hello With GA Push Event tracking set up -

Top Contributor
# 7
Top Contributor

Hi @Phillip D  :-)

 

Shouldn't the goal track every-time the Burton is clicked?
No, an event will track each time the button is clicked.
A goal though, tracks only once during the same session, regardless of how many times the button is clicked.

 

Are you able to pls provide a link to the page that the button is on?

 

Thanks :-)

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

 

It's the last button Request an eVisit on the page (right above the footer)

http://utidoctors.com/

 

this is the code:

<div style="text-align: center;">
<button style="background:none;" onclick="window.open('https://app.evisit.com/ng/#/enroll/utidoctors','_blank');ga('send', 'event', 'Evisit Button', 'clicked');">
<img width="200" height="38" src="http://utidoctors.com/wp-content/uploads/2017/05/visit22.png" class="vc_single_image-img attachment-full" alt="Request an eVisit" /></button>
</div>

Re: Hello With GA Push Event tracking set up -

Top Contributor
# 9
Top Contributor

Thank you, that helps! :-)

The website is using the legacy version of tracking code (ga.js) which uses a different code syntax.

 

<div style="text-align: center;">
<button style="background:none;" onclick="window.open('https://app.evisit.com/ng/#/enroll/utidoctors','_blank');gaq.push(['_trackEvent', 'Evisit Button', 'clicked']);">
<img width="200" height="38" src="http://utidoctors.com/wp-content/uploads/2017/05/visit22.png" class="vc_single_image-img attachment-full" alt="Request an eVisit" /></button>
</div>

 

If at some stage you decide to upgrade the tracking code on the site to the current universal analytics analytics.js,

a migration guide can be found here:

https://developers.google.com/analytics/devguides/collection/upgrade/

 

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Hello With GA Push Event tracking set up -

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

so I copy paste and we should be good?