Google AdWords Conversion without loading a thankyou page
Hi!
I would like to make Contour execute the Google conversion tracking code when a form has been submitted.
The thing that makes this a bit complicated is that I do not want a separate thank you page. So far so good, but the challenge is where to put the conversion code.
Can anyone give me a hint?
Parts of the code that shall be executed is shown below and since no page is loaded/reloaded I am a bit lost.
<!-- Google Code for .. Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxx ;
var google_conversion_language = "sv";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "xcxc";
var google_conversion_value = 0;
if (100) {
google_conversion_value = 100;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" </div>
</noscript>
Google AdWords Conversion without loading a thankyou page
Hi!
I would like to make Contour execute the Google conversion tracking code when a form has been submitted.
The thing that makes this a bit complicated is that I do not want a separate thank you page. So far so good, but the challenge is where to put the conversion code.
Can anyone give me a hint?
Parts of the code that shall be executed is shown below and since no page is loaded/reloaded I am a bit lost.
<!-- Google Code for .. Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxx ;
var google_conversion_language = "sv";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "xcxc";
var google_conversion_value = 0;
if (100) {
google_conversion_value = 100;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" </div>
</noscript>
Comment author was deleted
Well binding it to the form submit button would be the obvious option.
Hi,
Could you indicate in which file this modification can be done ?
Best Regards
Gudmund
It's a bit tricky, but you can do it by using jQuery to append a Iframe with a src loading a page containing the Conversion code.
We use a altTemplate to keep it neat, call your template something like iframetracking
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head>
</head>
<body>
<!-- Google Code for .. Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxx ;
var google_conversion_language = "sv";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "xcxc";
var google_conversion_value = 0;
if (100) {
google_conversion_value = 100;
}
/* ]]> */
</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="" </div>
</noscript>
</body>
</html>
</asp:Content>
Then in the settings of the form in the "Message on submit" box add the following:
<script type="text/javascript">
$('<iframe src="'+document.location.href+'?altTemplate=iframetracking" width="0px" height="0px"></iframe>').appendTo($('body'));
</script>
Forgot to mention you need to have jQuery included in the head of your page.
Hi!
Great. Thank you very much ;-)
Best Regards
Gudmund
Hi All,
You are having any idea/implementation about AdWords like Google in umbraco site.
Regards,
Pushpendra Singh
is working on a reply...