Post by aaron4osu » Tue Aug 25, 2015 11:40 pm

I was hoping someone could help me customize my adwords tracking code to include the value of a checkout.


Here is the sample conversion code for custom values:

Code: Select all

<!-- Google Code for Purchase Conversion Page -->
	<script type="text/javascript">
	/* <![CDATA[ */
	var google_conversion_id = 1234567890;
	var google_conversion_language = "en_US";
	var google_conversion_format = "1";
	var google_conversion_color = "666666";
	var google_conversion_label = "xxx-XXx1xXXX123X1xX";
	var google_conversion_value = 1;
	if (<? echo $totalValue ?>) {
		var google_conversion_value = <? echo $totalValue ?>
		var google_conversion_currency = <? echo $currency ?>
	}
	var google_conversion_currency = "USD";
	/* ]]> */ 
	</script>
	<script type="text/javascript"
	src="//www.googleadservices.com/pagead/conversion.js">
	</script>
	<noscript>
	<img height=1 width=1 border=0
	src="//www.googleadservices.com/pagead/
	conversion/1234567890/?value=
	<? echo $totalValue ?>&conversion_currency=<? echo $currency ?>
	&label=Purchase&script=0">
	</noscript>
I have my conversion code near the bottom of success.tpl file so that it triggers anytime someone arrives on the page, even if it's just from signing up for an account or newsletter signup. Ideally, if the user is just signing up for an account or newsletter the value would stay the same but if they purchased something I want to save that price as a the $totalValue variable.

Also, I'm not sure if I need $currency to be a variable since all of our sales are in us currency.

if it helps here is the article i pulled the sample code from:
https://support.google.com/adwords/answer/6095947?hl=en

Thanks,

Aaron

Newbie

Posts

Joined
Fri Nov 22, 2013 3:21 am

Post by PatEdge » Sun Apr 17, 2016 6:14 pm

It should be <?php echo $total; ?>

Newbie

Posts

Joined
Sun Apr 17, 2016 6:13 pm
Who is online

Users browsing this forum: No registered users and 361 guests