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
2.1K members online now
2.1K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Button Tracking and Conversions

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I have to track the click on a button "Buy on Amazon" which takes to Amazon site. I am interested to see the number of clicks on the button. (My website is in Squarespace, I have added Amazon block).

 

When I add ga('send', 'event', 'Button', 'Click', 'Click on- Buy on Amazon');- UA tracks a lots of events but the conversion is 0.

I tried with onClick and pasted in the html section

<a href="Buy on Amazon” onClick="ga('send', 'event', 'Buy on Amazon', 'Click', 'Click on- Buy on Amazon');">

StilI see no tracking and 0 conversion with the onclick.

 

Please help me fix this.

 

Thanks,

Swati

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Jassie D
January 2016

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 4
Participant ✭ ✭ ☆
Make sure that you have set your goal properly.
A single one mistake can cause that your conversion will not count.
If you can see event in your reports this is the only reason that this could happen.

View solution in original post

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆
If you can see events in Google Analytics you have to configure goals based on this events.
Go to Analytics Admin > Goals and create new Goal based on your event data.

Re: Button Tracking and Conversions

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks for your response!

I have already set the Goal as an event and all the category, action etc. are the same as code. But still I see 0 conversions.
I see conversions for other goals.
What could be the case and possible solution?

Thanks!
Marked as Best Answer.
Solution
Accepted by topic author Jassie D
January 2016

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 4
Participant ✭ ✭ ☆
Make sure that you have set your goal properly.
A single one mistake can cause that your conversion will not count.
If you can see event in your reports this is the only reason that this could happen.

Re: Button Tracking and Conversions

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
I feel ga(send, event...) is sending me the pageviews as events. I have setup goals as event and check the fields to be exactly the same as the code.

So I added onclick="ga... but it shows an error and the conversion is still 0. I also tried with <a href> in the html section of the code, but not the right tracking and 0 conversion.

Please help me fix the code. What am I missing. The website is in Squarespace, the ir is no particular button block to insert the code. So I have to inject the <a href> into the head of the code.

My trial and error codes for UA tracking

1. <button type='submit' id= ' yui_3_17_2_1_1452976256603_676'
onClick="ga('send', 'event', ''Buy on Amazon ', 'Click', ''Click on- Buy on Amazon '1);">

2.<a href="Buy On Amazon target="_blank" onclick="ga('send', 'event', ''Buy on Amazon ', 'Click', ''Click on- Buy on Amazon ');">

I am very new to this and have no coding knowledge. Please help in fixing this and making the conversion rate.

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 6
Participant ✭ ✭ ☆

Is it exactly the code you have on your website?
Because there is too many quotes in the ga function.

 

It should be:

<button type='submit' id= ' yui_3_17_2_1_1452976256603_676'
onClick="ga('send', 'event', 'Buy on Amazon', 'Click', 'Click on- Buy on Amazon');">

 

and

<a href="Buy On Amazon target="_blank" onclick="ga('send', 'event', 'Buy on Amazon', 'Click', 'Click on- Buy on Amazon');">

Re: Button Tracking and Conversions

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Thanks for your patience and reply.
I pasted the exact code but no luck!

Should there be something else like listeners and other zargons?

I pasted the <button>... below the UA tracking code in the header of the page.

I clicked on Inspect element on the Buy on Mazon button and found that its details is
<input type="button" class="sqs-amazon-button sqs-system-button sqs-editable-button" value="Buy on Amazon" id="yui_3_17_2_1_1452976256603_676">&lt;script&gt;

Unable to get the solution. This button opens third party-Amazon's page.

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 8
Participant ✭ ✭ ☆
Could you share your website URL so I can have a look at the code?

Re: Button Tracking and Conversions

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Re: Button Tracking and Conversions

Participant ✭ ✭ ☆
# 10
Participant ✭ ✭ ☆
You have old tracking code on your website so you have to use classic code syntax.

Instead of this:
ga('send', 'event', 'Buy on Amazon', 'Click', 'Click on- Buy on Amazon');
use this:
_gaq.push(['_trackEvent', 'Buy on Amazon', 'Click', 'Click on- Buy on Amazon']);