Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Correct code for Google Conversion Tracking


Andreas2003

Recommended Posts

Hi there,

 

I'm struggling around with the integration of the Google Conversion Tracking Code in my checkout_success.php.

 

I only want to submit the value of the shopping cart. Not the complete content of the cart.

 

For the submission of the variable "conversion_value", I found several possibilities for the code and want to know, which one works correctly:

 

1. possibility

if (1.0) {
 var google_conversion_value = <?php echo round($order_total['value'],2);?>;
}

 

2. possibility

if (total_cost) {
 google_conversion_value = total_cost;
}

 

3.possibility

if (total_cost) {
 var google_conversion_value = total_cost;
}

 

4.possibility

if (<?php echo $order->info['total']; ?>) {
var google_conversion_value = <?php echo $order->info['total']; ?>;
}

 

5.possibility

if (<? echo $total ?>) {
var google_conversion_value = <? echo $total ?>;
}

 

6.possibility

if (<?php echo $customer_info[value] ?>) {
var google_conversion_value = <?php echo $customer_info[value] ?>;
}

 

 

The second question is, if the values have to be submitted in in "quotation marks" or not ??

var google_conversion_language = "en_GB"

or

var google_conversion_language = en_GB

 

Thanks in advance,

kind regards

Andreas

Link to comment
Share on other sites

  • 3 years later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...