Hello,
I am trying to setup Google Adwords conversions tracking code
since my subscription value may change due to discounts
I'd like to implement the possibility to track the exact value of each conversion
question:
what is the PHP expression that displays the conversion value in Emerald?
For example: <?php echo $totalValue ?>
, <? echo totalValue ?>
Thank you
For setting this up I am referring to this google support article
and the specific explanation is this:
To add conversion tracking code to PHP pages using your web page editor, refer to the code below, then remove from your own code the lines that are crossed out and manually add the areas that are highlighted. If you're tracking button or link clicks as conversions instead of page loads, then the changes to your code will be slightly different. See these instructions for tracking clicks as conversions for more information.
<!-- 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 = 10;
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>
</body>
Open your conversion confirmation page PHP file. If multiple pages are generated from the same file, find the section in the PHP file which generates your conversion page.
If your site has a variable conversion value, determine the PHP expression that displays that value. For example: , echo totalValue ?>
Choose the "Purchase/Sale" conversion category while going through the conversion tracking setup.
Enter a default numeric value in the "Conversion value" field, then replace the line var google_conversion_value = … manually with the following:
if (<%= totalValue %) {
var google_conversion_value = <%= totalValue %>;
}
You'll also need to replace the default numeric value with <%= totalValue%> in the <noscript>
section of the tag highlighted above.
(Optional) If you accept different currencies, add a line within the if statement to accept currency: var google_conversion_currency = <? echo $currency ?>
In the noscript section of the tag, make sure that you add ¤cy_code=<? echo $currency ?>
Copy and save the resulting code snippet.
Insert the conversion tracking code on to the conversion confirmation page. Make sure that the code appears within a static HTML section, not contained within a PHP code section (delineated by <?
and ?>
markers). As you insert the code snippet, make sure that you place it directly into the body of the conversion confirmation page. To make sure that you do, search for the
Hello, I am trying to setup Google Adwords conversions tracking code
since my subscription value may change due to discounts I'd like to implement the possibility to track the exact value of each conversion
question:
what is the PHP expression that displays the conversion value in Emerald? For example:
<?php echo $totalValue ?>
,<? echo totalValue ?>
Thank you
For setting this up I am referring to this google support article
and the specific explanation is this:
To add conversion tracking code to PHP pages using your web page editor, refer to the code below, then remove from your own code the lines that are crossed out and manually add the areas that are highlighted. If you're tracking button or link clicks as conversions instead of page loads, then the changes to your code will be slightly different. See these instructions for tracking clicks as conversions for more information.
Open your conversion confirmation page PHP file. If multiple pages are generated from the same file, find the section in the PHP file which generates your conversion page. If your site has a variable conversion value, determine the PHP expression that displays that value. For example: , echo totalValue ?> Choose the "Purchase/Sale" conversion category while going through the conversion tracking setup. Enter a default numeric value in the "Conversion value" field, then replace the line var google_conversion_value = … manually with the following:
You'll also need to replace the default numeric value with <%= totalValue%> in the
<noscript>
section of the tag highlighted above. (Optional) If you accept different currencies, add a line within the if statement to accept currency: var google_conversion_currency =<? echo $currency ?>
In the noscript section of the tag, make sure that you add
¤cy_code=<? echo $currency ?>
Copy and save the resulting code snippet. Insert the conversion tracking code on to the conversion confirmation page. Make sure that the code appears within a static HTML section, not contained within a PHP code section (delineated by<?
and?>
markers). As you insert the code snippet, make sure that you place it directly into the body of the conversion confirmation page. To make sure that you do, search for the