Page 1 of 1

Adcenter / Adwords Conversion tracking

Posted: Tue Feb 14, 2012 4:17 pm
by crazyjoe
Does anyone have a good Conlib created for tracking Revenue for Adcenter and Adwords? My Google Analytics works perfectly but AdCenter & AdWords do not register the Order Total or Order Number for each order. I see what Mahzer did in this post a couple years ago... viewtopic.php?f=42&t=12481 But I do not understand enough to re-write for AdCenter and AdWords, I'm sure someone else has. Can anyone help with this?

Re: Adcenter / Adwords Conversion tracking

Posted: Tue Feb 12, 2013 2:49 pm
by jhmac
Hello Joe,
Did you ever get your tracking working for adcenter and adwords? I am have a bit of a hard time with that myself?
thanks

Re: Adcenter / Adwords Conversion tracking

Posted: Tue Feb 12, 2013 3:06 pm
by crazyjoe
No, sadly I have not. It's cool though, who really needs to figure out ROI's anyway. Please post up some code examples if you get it going.

Re: Adcenter / Adwords Conversion tracking

Posted: Thu Sep 26, 2013 11:19 am
by crockettdunn
I'm working on this again. I was hoping to discover nVelocity vars available in the receipt page so I could do on the scriptlet level, but no luck (tried nvelocity order variables from email templates).

So now I'm going to try to put the OrderTotal in a hidden INPUT and set the value of the AdWords conversion to the value of that <%= INPUT.ClientID %>

If anyone has already solved this problem or has an idea for a better way, please let me know.

Re: Adcenter / Adwords Conversion tracking

Posted: Thu Sep 26, 2013 1:00 pm
by crockettdunn
Here is what I went with.
In the codebehind:

Code: Select all

TotalCharges.Text = string.Format("{0:ulc}", Order.TotalCharges);
//2013.09.26 hcd total charges to hidden input for conversion value tracking
//also insert literal for noscript img tracking of conversion
ConversionValue.Value = TotalCharges.Text.Replace("$", String.Empty); //hidden input
lConversionValue.Text = ConversionValue.Value; //literal


and in the ascx

Code: Select all

               
<asp:Label ID="TotalCharges" runat="server" Text=""></asp:Label>
<%--//2013.09.26 hcd total charges to hidden input for conversion value tracking --%>
<asp:HiddenField  id="ConversionValue" runat="server" />
then the AdWords conversion tracking at the end of the file:

Code: Select all

<uc:AffiliateTracker ID="AffiliateTracker1" runat="server" />
<!-- Google Code for Completed Online Sale (receipt.aspx) Conversion Page  
-->
<!-- //not on dev site -->
<!--script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = ##########;
var google_conversion_language = "en";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "$$$$$$$$$$$$$$$$$";
var google_conversion_value = document.getElementById("<%= ConversionValue.ClientID %>").value
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/##########/?value=<asp:Literal id="lConversionValue" Text="" runat="server" />&label=$$$$$$$$$$$$$&guid=ON&script=0"/ -->
</div>
</noscript>
in retrospect my brain wasn't working right when I went with the hidden input, which results in another possible failure point. Two literals would have been simpler :| .