- Posts: 4
- Thank you received: 0
Google Adwords
- rafael_josem
-
Topic Author
- Offline
Less
More
12 years 3 months ago #162657
by rafael_josem
Google Adwords was created by rafael_josem
-- url of the page with the problem -- : N/A
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : N/A
Hello,
How can I place this google adwords code? The "var google_conversion_value" much change according to the product price.
Thanks
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : N/A
Hello,
How can I place this google adwords code? The "var google_conversion_value" much change according to the product price.
Code:
<!-- Google Code -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1008879972;
var google_conversion_language = "es";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "dmuACJSH3R4Q5JKJ4QM";
var google_conversion_value = 25.000000;
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/1008879972/?value=25.000000&label=dmuACJSH3R4Q5JKJ4QM&guid=ON&script=0"/>
</div>
</noscript>
Thanks
Please Log in or Create an account to join the conversation.
12 years 3 months ago #162769
by Xavier
Replied by Xavier on topic Google Adwords
Hi,
I guess this needs to be in the product page, so you can edit the view "product / show_default" and add you code at the end of the view.
To have a dynamic conversion_value, you can use this code:
I guess this needs to be in the product page, so you can edit the view "product / show_default" and add you code at the end of the view.
To have a dynamic conversion_value, you can use this code:
Code:
<!-- Google Code -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1008879972;
var google_conversion_language = "es";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "dmuACJSH3R4Q5JKJ4QM";
var google_conversion_value = <?php echo $this->element->prices[0]->price_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/1008879972/?value=<?php echo $this->element->prices[0]->price_value; ?>&label=dmuACJSH3R4Q5JKJ4QM&guid=ON&script=0"/>
</div>
</noscript>
Please Log in or Create an account to join the conversation.
- rafael_josem
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
12 years 3 months ago #162849
by rafael_josem
Replied by rafael_josem on topic Google Adwords
Hello,
I actually needed to be in the "thank you page", since it is a tracking conversion code. My "After end" looks like this, since I also have a FB conversion code tracking. Notice that there isn't a "?>" closing tag by default (it was already like that), so I don't know if I should just paste the google adword code as it is.
Thanks.
I actually needed to be in the "thank you page", since it is a tracking conversion code. My "After end" looks like this, since I also have a FB conversion code tracking. Notice that there isn't a "?>" closing tag by default (it was already like that), so I don't know if I should just paste the google adword code as it is.
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.1
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
$js ="(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6014693896236', {'value':'".round($order->order_full_price,2)."','currency':'USD'}]);";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
Thanks.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #163278
by Xavier
Replied by Xavier on topic Google Adwords
Hi,
Yes so you can add the following code after the one for FB.
Yes so you can add the following code after the one for FB.
Code:
?>
<!-- Google Code -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1008879972;
var google_conversion_language = "es";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "dmuACJSH3R4Q5JKJ4QM";
var google_conversion_value = <?php echo round($order->order_full_price,2); ?>;
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/1008879972/?value=<?php echo round($order->order_full_price,2); ?>&label=dmuACJSH3R4Q5JKJ4QM&guid=ON&script=0"/>
</div>
</noscript>
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175486
by boopoo
Replied by boopoo on topic Google Adwords
Hi Xavier,
I would like some help with adding Google Adwords conversion tracking code to 2 pages on my site. I have HS Essential, not Business, so cannot use the plugin you have and have to add the code manually.
I would like to add the code to the two following pages:
- The payment thank you page you get to after you pay using 'bank transfer'.
- A custom thank you page I have created on my site (Joomla article).
Can you offer advice where I go to add the code to both of these pages. My PHP knowledge is very bad so any help greatly appreciated.
Thank you in advance
Thank you
I would like some help with adding Google Adwords conversion tracking code to 2 pages on my site. I have HS Essential, not Business, so cannot use the plugin you have and have to add the code manually.
I would like to add the code to the two following pages:
- The payment thank you page you get to after you pay using 'bank transfer'.
- A custom thank you page I have created on my site (Joomla article).
Can you offer advice where I go to add the code to both of these pages. My PHP knowledge is very bad so any help greatly appreciated.
Thank you in advance
Thank you
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175490
by nicolas
Replied by nicolas on topic Google Adwords
So the full that you need is this one (with modifications of your google adwords data):
You can add it in the file plugins/hikashoppayment/banktransfer/banktransfer_end.php in order to have it for the thank you page of the bank transfer payment method.
For your Joomla article, you'll need to use a plugin like sourcerer in order to add the code in a Joomla article.
If you need someone with more experience in PHP to do that for you, you can contact our partners for a quote:
www.hikashop.com/home/our-partners.html
Code:
<?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
?>
<!-- Google Code -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1008879972;
var google_conversion_language = "es";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "dmuACJSH3R4Q5JKJ4QM";
var google_conversion_value = <?php echo round($order->order_full_price,2); ?>;
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/1008879972/?value=<?php echo round($order->order_full_price,2); ?>&label=dmuACJSH3R4Q5JKJ4QM&guid=ON&script=0"/>
</div>
</noscript>
For your Joomla article, you'll need to use a plugin like sourcerer in order to add the code in a Joomla article.
If you need someone with more experience in PHP to do that for you, you can contact our partners for a quote:
www.hikashop.com/home/our-partners.html
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175665
by boopoo
Replied by boopoo on topic Google Adwords
Nicolas,
As always, your reply has been appreciated. Thank you.
As always, your reply has been appreciated. Thank you.
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #175859
by boopoo
Replied by boopoo on topic Google Adwords
Hi Nicolas,
In the file 'plugins/hikashoppayment/banktransfer/banktransfer_end.php' do I need to add this code below that you listed? I was just going to add the code that Google gave me.
In the file 'plugins/hikashoppayment/banktransfer/banktransfer_end.php' do I need to add this code below that you listed? I was just going to add the code that Google gave me.
Code:
<?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id,false,false);
?>
Last edit: 11 years 11 months ago by Jerome. Reason: [code] is nice !!
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #175862
by boopoo
Replied by boopoo on topic Google Adwords
So you better understand, in the file 'plugins/hikashoppayment/banktransfer/banktransfer_end.php' I have the following code below. At the very bottom of that I was going to add the Google code...
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.3
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div class="hikashop_banktransfer_end" id="hikashop_banktransfer_end">
<span class="hikashop_banktransfer_end_message" id="hikashop_banktransfer_end_message">
<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
JText::sprintf('PLEASE_TRANSFERT_MONEY',$this->amount).'<br/>'.
$this->information.'<br/>'.
JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$this->order_number).'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>
</span>
</div>
<?php
if(!empty($this->return_url)){
$doc = JFactory::getDocument();
$doc->addScriptDeclaration("window.addEvent('domready', function() {window.location='".$this->return_url."'});");
}
Last edit: 11 years 11 months ago by Jerome. Reason: [code] is nice !!
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175877
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Google Adwords
Hi,
When you post code, please use the "code" tag.
I do not see any custom code in your view ; please do not post code of views that are directly in HikaShop ; don't worry we also have access to the source code of the views.
What is your question ?
Regards,
When you post code, please use the "code" tag.
I do not see any custom code in your view ; please do not post code of views that are directly in HikaShop ; don't worry we also have access to the source code of the views.
What is your question ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #175946
by boopoo
Replied by boopoo on topic Google Adwords
Apologies Jerome. I will use the code tags from now on.
I will replace the code in the file 'plugins/hikashoppayment/banktransfer/banktransfer_end.php' with the following below. Can you please tell me if that is correct?
I will replace the code in the file 'plugins/hikashoppayment/banktransfer/banktransfer_end.php' with the following below. Can you please tell me if that is correct?
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.3
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div class="hikashop_banktransfer_end" id="hikashop_banktransfer_end">
<span class="hikashop_banktransfer_end_message" id="hikashop_banktransfer_end_message">
<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
JText::sprintf('PLEASE_TRANSFERT_MONEY',$this->amount).'<br/>'.
$this->information.'<br/>'.
JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$this->order_number).'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>
</span>
</div>
<?php
if(!empty($this->return_url)){
$doc = JFactory::getDocument();
$doc->addScriptDeclaration("window.addEvent('domready', function() {window.location='".$this->return_url."'});");
}
?>
<!-- Google Code for Adwords sale tracking Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = XXXXXXXXXXXX;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "XXXXXXXXXXXX";
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/XXXXXXXXXXX/?label=7ORjCKj95FYQ-Y2p3gM&guid=ON&script=0"/>
</div>
</noscript>
Last edit: 11 years 11 months ago by boopoo.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175948
by Xavier
Replied by Xavier on topic Google Adwords
Hi,
Yes it seems to be correct.
Yes it seems to be correct.
Please Log in or Create an account to join the conversation.
Time to create page: 0.326 seconds