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

conversion tracking with no thank you page

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there.

I am trying to add the Adwords conversion code to my site, unfortuntely when the form is submitted the thank you message appears on the same page, so there is therefore no stand alone thank you page.

 

My understanding is that, to get around this issue, I simply need to set a jquery function that will add the image to the page when a user submits the form. See example below:

 

$('body').append('<img src="http://www.googleadservices.com/pagead/conversion/1062471647/?value=0&amp;label=hIzHCNn1gAQQ34_Q-gM&..." height="1" width="1" style="border-style:none;"/>');

 

Is this the only code I need to add to the page, or is there code that I have left out which is needed?

 

Many thanks

3 Expert replyverified_user

Re: conversion tracking with no thank you page

Top Contributor
# 2
Top Contributor

Hi latitudeCA and welcome to the forum.

 

All you need do is insert the Conversion Code - the full code - in the part of the page script that renders the "thank you".  It doesn"t matter if it's a separate page or the same page, only that it only triggers on a conversion.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: conversion tracking with no thank you page

Top Contributor
# 3
Top Contributor

Hi latitudeCA,

 

I don't use jquery, so I really can't tell you if the syntax is correct. I can tell you that if the syntax is correct, that is all you need to do. I usually do it with var oImg = new Image(). Then assign the src. You really don't even need to show the returned image, as long as your privacy statement says something about the AdWords tracking cookie.

 

Best of Luck!

 

Pete

 

petebardo -- Deadhead doing AdWords

Re: conversion tracking with no thank you page

Top Contributor
# 4
Top Contributor

Yes, but why not do it using the full code from Adwords?

 

J

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

YouRe: conversion tracking with no thank you page

Top Contributor
# 5
Top Contributor

Another option (and this is quite a simple one) is to add event tracknig to the submit button of the form.

 

The event can then be configured as a goal in analytics (this is a relatively recent change - and very welcome - it finally makes events worthwhile - I could seldom see the point before) - this can then be imported as a conversion in AdWords...

 

sorted

Re: YouRe: conversion tracking with no thank you page

Top Contributor
# 6
Top Contributor

Sorry, I'll say it again, I see nothing in latitudeCA's original post that suggests you shouldn't be able to use the standard, original conversion code from Adwords.  It doesn't matter that the "thank you" is physically the same page, you can still include the conversion code in such a way that it only renders when the completion event occurs.  In this case I'd imagine there's a conditional statement somewhere that decides when to show the "Thank You" text and you'd just drop the Conversion code into there.

 

I've done this countless times, it doesn't have to be complicated.

 

J

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: YouRe: conversion tracking with no thank you page

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

I have the same problem so basically all I need to do is put the tracking code somewhere within the "contact.js" code?

 

Any ideas where i should stick it ?

 

$(function()
{
$("#feedback form").submit(function()
{
var form = $(this);
var str = form.serialize();
$.ajax(
{
type: "POST",
url: "contact.php",
data&colon; str,
success: function(msg)
{
$("#feedback .result .alert").remove();
msg = JSON.parse(msg);

if(msg.status == 'OK')
{
$('#feedback .result').append('<div class="alert alert-success">Your message has been sent. Thank you!<button type="button" class="close" data-dismiss="alert">×</button></div');
}
else if(msg.text)
{
$.each(msg.text, function(i, elem){
$('#feedback .result').append('<div class="alert alert-error">' + elem + '<button type="button" class="close" data-dismiss="alert">×</button></div');
})
}
else
{
$('#feedback .result').append('<div class="alert alert-error">Error<button type="button" class="close" data-dismiss="alert">×</button></div');
}
}
})
return false;
})
})

Re: YouRe: conversion tracking with no thank you page

Top Contributor
# 8
Top Contributor

Hi David, I'll admit I'm not a JavaScript expert, in fact I wouldn't even qualify as an amateur in most scenarios, I'm a PHP man, so I'm looking at this code from a procedural view rather than knowing that it'll work in JS, if you see what I mean.

 

It looks to me that the position you want is within the conditional that begins:

 

if(msg.status == 'OK')

{

 

as this is the part that displays the "success" message to the visitor.  You should insert the code after the first {

 

Let us know how you get on.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: YouRe: conversion tracking with no thank you page

Top Contributor
# 9
Top Contributor

Hi David,

 

Since you are using a post back (aka Ajax), script returned with the post back does not run. Just return the image part of the conversion code, not including the noscript tags, and the conversion will record just fine.

 

Best of Luck!

 

Pete

 

petebardo -- Deadhead doing AdWords

Re: conversion tracking with no thank you page

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
Thanks for the advice guys will have a crack over the weekend

Atb

Dave