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

N/A
# 1
N/A

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

 

 

 

 

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

N/A
# 3
N/A
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
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

N/A
# 5
N/A
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

N/A
# 7
N/A
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

N/A
# 9
N/A

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']);