Author Topic: Google Adwords Conversion Tracking  (Read 27549 times)

oviliz

  • Beginner
  • *
  • Posts: 27
Re: Google Adwords Conversion Tracking
« Reply #30 on: July 14, 2014, 17:25:50 pm »
In the end I solved with that plugin, virtuemartrackingextension.com

ITechnoDev

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 27
    • Extensions for VirtueMart
Re: Google Adwords Conversion Tracking
« Reply #31 on: July 14, 2014, 17:59:03 pm »
Gi Peter, can you please provide more details?

I made added the AdWords code at the end of my:
components/com_virtuemart/views/cart/tmpl/order_done.php
and
components\com_virtuemart\views\pluginresponse\tmp l\default.php

From the AdWords code, specific to my account, I changed only:
var google_conversion_value = 1.00;
with
var google_conversion_value = <?php echo $this->cart->pricesUnformatted['billTotal'] ?>;

I don't understand well the (same?) code about IMG src.

Anyway after that change the visitors confirmation orders are redirected to a blank cart/confirm.php page.

It means that there is a php error try to display the errors
Extensions for VirtueMart : http://www.itechnodev.com

ITechnoDev

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 27
    • Extensions for VirtueMart
Re: Google Adwords Conversion Tracking
« Reply #32 on: July 14, 2014, 18:18:13 pm »
In the end I solved with that plugin, virtuemartrackingextension.com

one page checkout component also have this feature
Extensions for VirtueMart : http://www.itechnodev.com

Peter Pillen

  • Jr. Member
  • **
  • Posts: 223
Re: Google Adwords Conversion Tracking
« Reply #33 on: July 15, 2014, 16:28:26 pm »
The code in the order-done file looks like this ... and this code needs to be placed in the different payment plugins that generate the "thank you for your order page". The google image url also needs part of the tracking code. It displays to the customer that google tracking is used. Depending per country you need to show this to the customers. If you don't need to show it - like me - give it a width and height of 1. In the code below the xxxxxxx stands for your google tracking id that is generated by google.

Code: [Select]
<?php

defined
('_JEXEC') or die('');

echo 
"<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo 
"<p>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_NOTICE')."</p>";
echo 
$this->html;

?>

<!-- Google Code for verkoop Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
//enter your id number instead of the xxxxxx
var google_conversion_id = xxxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "Ze5ZCPmL-gcQ94LN3gM";
var google_conversion_value = <?php echo $this->cart->pricesUnformatted['billTotal'?>;
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/xxxxxxxxxxxx/?value=<?php echo $this->cart->pricesUnformatted['billTotal'?>&amp;label=Ze5ZCPmL-gcQ94LN3gM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

escozul

  • Beginner
  • *
  • Posts: 32
  • Skype Name: escozul
Re: Google Adwords Conversion Tracking
« Reply #34 on: August 12, 2014, 22:38:34 pm »
There are people who insist that the google tracking code needs to be placed before the
Code: [Select]
echo $this->html; part of the original order_done.php

I guess that the code would become as so:
Code: [Select]
<?php
defined
('_JEXEC') or die('');
?>

<div class="order">
<?php
echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";

echo 
'<!-- Google Code for Order Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = xxxxxxxxxxxx;
    var google_conversion_language = "el";
    var google_conversion_format = "3";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "sqf7COeAtggQkeiqxgM";
    var google_conversion_value = $this->cart->pricesUnformatted["billTotal"];
    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/xxxxxxxxxxxx/?value=$this->cart->pricesUnformatted["billTotal"]&amp;label=sqf7COeAtggQkeiqxgM&amp;guid=ON&amp;script=0"/>
    </div>
    </noscript>'
;

echo 
$this->html;
?>

</div>;

Would that work? Is that maybe the better way to go?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8592
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Google Adwords Conversion Tracking
« Reply #35 on: August 12, 2014, 23:57:20 pm »
can't see it would make the slightest difference
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Danke

  • Beginner
  • *
  • Posts: 1
Re: Google Adwords Conversion Tracking
« Reply #36 on: September 26, 2014, 13:10:10 pm »
Hi all

Thank you for all your posts. Unfortunatelly it's not working for me. I use virtuemart 2.6.6

I've puttet the code like you descripted in:
/components/com_virtuemart/views/cart/tmpl/order_done.php

If i watch at the source of the confirmation page i can't see the tracking code. So it looks like I'm on the false file. But I can't find any other order_done.php.

Quote from logobis:
Quote
I'm user of Google ADWORDS and I confirm that the code should be implement in order_done.php (templates/YOUR_TEMPLATE/html/com_virtuemart/cart/order_done.php). IN my case, it's works perfectly even with 4 kinds of payments-> Paypal, Credit Card (ATOS), Check and Bank Transfer.
I use in virtuemart configuration -> templates -> shopfront settings -> "use joomla default"
But in the default template, i don't have a com_virtuemart folder, it's not existing. Neighter in one of the other templates.

Can anyone help me?

Thank you

Rune Rasmussen

  • Jr. Member
  • **
  • Posts: 161
  • Is the stable release stable?
    • SYNTAX ERROR
  • VirtueMart Version: Latest ;)
Re: Google Adwords Conversion Tracking
« Reply #37 on: November 03, 2014, 21:26:46 pm »
I've looked into this on VM 2.6.x and it's not working with t.ex "standard" payment module, as it's emptying the cart BEFORE the confirm page is shown.

Line 146 in /plugins/vmpayment/standard/standard.php: $cart->emptyCart ();

Thus $this->cart->pricesUnformatted['billTotal'] will display nothing, as it's empty.

We could comment line 146, but that's probably not a very good idea. Anyone having a better?
Maybe devs could consider to empty the cart later in the process, at the end of the confirmation page, instead of in each payment module?
Rune Rasmussen - http://www.syntaxerror.no
Norske nettløsninger og integrasjoner, CONSIGNOR EDI, Mamut ordreimport og produkteksport, kortbetaling og faktura m.m.

Norsk Joomla! - Norwegian Translation Team - http://www.norskjoomla.no

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: Google Adwords Conversion Tracking
« Reply #38 on: November 04, 2014, 01:57:39 am »
Hello

For the virtue mart piwik plugin, i wrote a system plugin with this event plgVmConfirmedOrder . It should work for Google Adwords also.

Rune Rasmussen

  • Jr. Member
  • **
  • Posts: 161
  • Is the stable release stable?
    • SYNTAX ERROR
  • VirtueMart Version: Latest ;)
Re: Google Adwords Conversion Tracking
« Reply #39 on: November 04, 2014, 07:37:00 am »
That's fine, but most people will not be able to do that. And a cart without Google Analytics and Adwords Conversion Tracking is not a "complete" cart.

Btw! From my point of view it seems weird to relay on the payment plugins to empty the cart, that's not very common for a cart system as far as I have seen.

It would be easy to move it I guess. And then add support for adding tracking codes in config, which is inserted to  components/com_virtuemart/views/cart/tmpl/order_done.php and components/com_virtuemart/views/pluginresponse/tmpl/default.php
Rune Rasmussen - http://www.syntaxerror.no
Norske nettløsninger og integrasjoner, CONSIGNOR EDI, Mamut ordreimport og produkteksport, kortbetaling og faktura m.m.

Norsk Joomla! - Norwegian Translation Team - http://www.norskjoomla.no

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 114
    • websites developed and managed @ ourfingertips.com
  • VirtueMart Version: 3.2.12 and 3.2.15
[SOLVED] Google Adwords Conversion Tracking
« Reply #40 on: July 21, 2015, 18:16:58 pm »
I have the following code that works for my VM 2.6 sites in template cart/order_done.php where the above suggested value from the cart doesn't work (because the cart is already cleared?) so I simply get the info directly from the database for the user as follows:

Code: [Select]
// begin Google AdWords Conversion added as per https://support.google.com/adwords/answer/6095947
// enter your values
$conversion_id = "1234567890"; // enter your conversion_id
$conversion_label = "abcDefghiJKLmnopqRS"; // enter your conversion_label
$currency = 'CAD'; // enter your currency - or get that from database too
// get this user
$user = JFactory::getUser();
$user_id=$user->id;
// get this order_id,order_total,order_status 
JFactory::getDBO()->setQuery("SELECT virtuemart_order_id,order_total,order_status FROM jos_virtuemart_orders WHERE virtuemart_user_id=$user_id ORDER BY virtuemart_order_id DESC LIMIT 1");
$this_order =JFactory::getDBO()->loadObjectList();
$this_order_id = $this_order[0]->virtuemart_order_id;
$this_order_total = number_format($this_order[0]->order_total, 2, '.', '');
$this_order_status = $this_order[0]->order_status;
//echo '<br />order id '.$this_order_id.' total $'.$this_order_total.' status '.$this_order_status;
if ($this_order_status == 'P' ) {
echo '<h2 style="color:#990000">!!! Sorry your payment did not process, if this is the first time this has happened to you please create a new order and make sure your payment information is correct before confirming it - if it fails again then please visit us or call us during office hours and we will be happy to help.</h2>';
}
echo '
<!-- Google Code for Order Done Conversion Page started 2015-07-21 -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = '.$conversion_id.';
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "'.$conversion_label.'";
var google_conversion_value = '.$this_order_total.';
var google_conversion_currency = "'.$currency.'";
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/'.$conversion_id.'/?value='.$this_order_total.'&amp;conversion_currency='.$currency.'&amp;label='.$conversion_label.'&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<!-- end of Google Code for Order Done Conversion Page started 2015-07-21 -->
';
// end Google AdWords Conversion



www.ourfingertips.com - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

Rune Rasmussen

  • Jr. Member
  • **
  • Posts: 161
  • Is the stable release stable?
    • SYNTAX ERROR
  • VirtueMart Version: Latest ;)
Re: Google Adwords Conversion Tracking
« Reply #41 on: August 10, 2018, 09:14:49 am »
Note! Google Adwords has been rebranded into Google Ads recently (July 2018).

I'll recommend the new 'BIT Google Ads for Virtuemart' plugin released by BARG IT: https://barg-it.de/en/online-shop/extensions-joomla-3/bit-google-ads-for-virtuemart.html

It works great, also with special checkout and payment modules like One Page Checkout and Klarna Checkout, like the rest of their also recommended tracking extensions (FB Pixels, G Analytics etc.): https://barg-it.de/en/online-shop/extensions-joomla-3/bit-virtuemart-tracking-paket.html
Rune Rasmussen - http://www.syntaxerror.no
Norske nettløsninger og integrasjoner, CONSIGNOR EDI, Mamut ordreimport og produkteksport, kortbetaling og faktura m.m.

Norsk Joomla! - Norwegian Translation Team - http://www.norskjoomla.no