AdWords
2.1K members online now
2.1K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Google conversion action onclick event

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Running into issues while trying to implement a Google conversion action. 

 

I have placed the following script in the body of my page:

 

**<!-- Google Code for Silver License Conversion Page
In your html page, add the snippet and call
goog_report_conversion when someone clicks on the
chosen link or button. -->
<script type="text/javascript">
/* <![CDATA[ */
goog_snippet_vars = function() {
var w = window;
w.google_conversion_id = 949318501;
w.google_conversion_label = "nuYVCNiV-14Q5ebVxAM";
w.google_remarketing_only = false;
}
// DO NOT CHANGE THE CODE BELOW.
goog_report_conversion = function(url) {
goog_snippet_vars();
window.google_conversion_format = "3";
window.google_is_call = true;
var opt = new Object();
opt.onload_callback = function() {
if (typeof(url) != 'undefined') {
window.location = url;
}
}
var conv_handler = window['google_trackConversion'];
if (typeof(conv_handler) == 'function') {
conv_handler(opt);
}
}
/* ]]> */
</script>
<script type="text/javascript"
src="//www.googleadservices.com/pagead/conversion_async.js">
</script>**

 

On the button I'd like to use to track conversions, the code is: 

 

**<div class="button_001"><input class="subscribe_button_01" name="submit" type="submit" value="Subscribe" onclick="goog_report_conversion" /></div>**

 

Unfortunately, I have no clue if this is right since it can take up to 24 hours to verify. 

 

Does anyone with advanced knowledge know if this looks right?

 

Thanks in advance for your help,

 

-A

 

 

 

 

1 Expert replyverified_user

Re: Google conversion action onclick event

Top Contributor
# 2
Top Contributor

Hi Andrew,

 

Your script is fine. Make sure you call the function like onclick="goog_report_conversion();" instead of onclick="goog_report_conversion".

 

Hope this helps, let me know if it works.


Arnold Majlath, Google Analytics Top Contributor
Circle Me On Google+ | Visit me @ Redfly Digital

Google conversion action onclick event

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi,

 

I'm glad I fount this post Smiley Happy

 

I have a question, where do you find this kind of adwords conversion code (w.google_conversion_id = 949318501;
w.google_conversion_label = "nuYVCNiV-14Q5ebVxAM";
w.google_remarketing_only = false; etc.) ?

 

When I create a conversion in my adwords account it only gives me this code :

 

<!-- Google Code for Adwords - Contactez-nous Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 932738545;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "thQVCNTQr3IQ8evhvAM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/932738545/?label=thQVCNTQr3IQ8evhvAM&amp;guid=ON&amp;scri...>
</div>
</noscript>

 

 

Thank you in advance for your reply

 

 

Google conversion action onclick event

Top Contributor
# 4
Top Contributor

Hi Andrea,

 

That code is for tracking clicks as conversions, please check the document below for more information:

https://support.google.com/adwords/answer/6331304?hl=en

Hope this helps.


Arnold Majlath, Google Analytics Top Contributor
Circle Me On Google+ | Visit me @ Redfly Digital