[Skip to main content](#vessel-content)

#   Integration of Facebook Pixel and other scripts

##

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 8 months ago -  10 years 8 months ago [\#232688](#232688) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232688 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")* was created by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")*

-- url of the page with the problem -- : [ travelsat.com.au/shop/satellite-dishes/product/minimax75-dish](http://travelsat.com.au/shop/satellite-dishes/product/minimax75-dish)
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Firefox 41.0.2
-- Error-message(debug-mod must be tuned on) -- : No message

Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.

**1. How to get price on product page (view show\_tabular)**. I need to insert this variable into Google Analytics Dynamic Remarketing script.
And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product_id ?

**2. How to add onlick event to add to cart button?**
In the file administrator/components/com_hikashop/helpers/cart.php I see this line:

$html= '&lt;input type="'.$type.'" class="'.$class.' button hikashop_cart_input_button'.$classname.'" name="'.$map.'" value="'.$name.'" '.$ajax.$options.'/&gt;';

I need to add custom script for onclick event. This code is:

&lt;script&gt;
var dataLayer = window.dataLayer &#124;&#124; [];
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': {
'ecomm_pagetype': 'cart',
'ecomm_prodid': '',
'ecomm_totalvalue':
}
});
&lt;/script&gt;

ecomm_prodid is product id
ecomm_totalvalue is price*quantity (there is a quantity box on the page)

I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:

$html= '&lt;input onclick='my script goes here' type="'.$type.'" class="'.$class.' button hikashop_cart_input_button'.$classname.'" name="'.$map.'" value="'.$name.'" '.$ajax.$options.'/&gt;';

this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:

&lt;input class="btn button hikashop_cart_input_button" name="add" value="Add to cart" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('137',field,1,0,'cart'); } else { return false; }" type="submit"&gt;

**3. Also how i can get values mentioned in question (2) in cart.php?**
ecomm_prodid is product id
ecomm_totalvalue is product_price*quantity (there is a quantity box on the page)

**4. I need to insert this code on after\_end view file:**

&lt;script&gt;
var dataLayer = window.dataLayer &#124;&#124; [];
dataLayer.push({
'event': 'fireRemarketingTag',
'google_tag_params': {
'ecomm_pagetype': 'purchase',
'ecomm_prodid': '',
'ecomm_totalvalue':
}
});
&lt;/script&gt;

Here is ecomm_prodid is array of products IDs, like: 'ecomm_prodid': [123, 456, 789],

'ecomm_totalvalue' - order price (sum of all prices for products in the order)

How can I get values for ecomm_prodid and ecomm_totalvalue?

Last edit: 10 years 8 months ago by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#232690](#232690) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232690 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

1. The price is available like this:
echo $this-&gt;element-&gt;prices[0]-&gt;price_value;

The product id is available like this:
echo $this-&gt;element-&gt;product_id;
However, if you have variants, that will give you the id of the default variant. If you want the id of the main product, you'll have to use this in that case:
echo $this-&gt;element-&gt;main-&gt;product_id;

2. You need to add your javascript code to the beginning of the $this-&gt;ajax variable in the file "quantity" of the view "product". That way, your javascript will be added automatically to the onclick code of the button.

3. In the file "quantity" of the view "product", where you should add your javascript, the product price and the product id can be retrieved as explained in point 1.

4. You can add a foreach on the array $this-&gt;order-&gt;products. Each element of that array will have an attribute "product_id" that you'll be able to use for your ecomm_prodid parameter.
The order total price can be found in $this-&gt;order-&gt;order_full_price

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#232832](#232832) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232832 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Thank you nicolas,

1-3 are successfully done with your help.
4. Could you please help me to create foreach command for getting product_id for all products in the order?
Also I see your answer here: [ www.hikashop.com/forum/checkout/875406-f...onversion-pixel.html](http://www.hikashop.com/forum/checkout/875406-facebook-conversion-pixel.html)

You recommended to use following structure in order to get order:

$app =JFactory::getApplication();
$order_id = $app-&gt;getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass-&gt;get($order_id);

So, will $this-&gt;order-&gt;order_full_price work, Or it's better to use mentioned code and then code $order-&gt;order_full_price?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#232835](#232835) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232835 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

4. It's just a standard foreach so it should be easy: Code:

$ids = array(); foreach($this-&gt;order-&gt;products as $product){ $ids[]=$product-&gt;product_id; } echo implode(',',$ids);

5. You can use either that code or directly $this-&gt;order. Both would contain the same thing.
The method from the other thread was given because I didn't know the version of that user as he didn't provide it and $this-&gt;order is only available in recent versions of HikaShop. So I gave him the solution with $order just to be sure it would work, but the version with $this-&gt;order is more efficient so I gave you this one since I know you're using the latest version of HikaShop.
You see: That's why it's important to always provide the version of HikaShop you're using when asking a question, like you did. If everyone would provide the information we ask in the new thread form of the forum, it would make our life easier ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#232902](#232902) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232902 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Thank you very much. But how it's possible to debug after_end view file? Checkout is redirecting me to PayPal and I don't understand if my code works or not.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#232903](#232903) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232903 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

The after_end view file is displayed after the payment, when the customer comes back on the website and see the "thank you for your purchase" message of HikaShop.
So when you reach that page, just look at the source of the page and you should find your generated code in there.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#232963](#232963) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232963 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

But I have set custom return url for payment plugin: [ travelsat.com.au/thankyou](https://travelsat.com.au/thankyou)

Will after_end file run my code at this case?
If no - I guess I can remove return url in payment plugin options and make redirect to thank you page at the end of after_end file?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#232997](#232997) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#232997 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

In that case no the after_end view file is skipped to go to your return URL.

So yes, if you want to redirect to a specific page, you should remove the return URL from your payment method, and instead, add a javascript redirect in the after_end view file. Make sure that you set a timer on the redirect so that the browser has the time to run the facebook javascript before starting the redirection.
Don't use the Joomla redirect as it would redirect the page before the facebook javascript would run.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#233076](#233076) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233076 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Ok, thank you for the reply.
Also I've noticed that all variables contain price without GST (tax). How can I add tax to all variables mentioned 1-4. It is constant tax cerruntly (10%) and I can add them manually to this variables, but if there is a way to get all variables with GST - i'd like to do it this way.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#233086](#233086) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233086 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

The price of each product in the order is stored with two variables. One for the price without tax and one for the taxes.
So if you want the price with taxes, you just have to sum both, like that:
echo ($product-&gt;order_product_price+$product-&gt;order_product_tax);

The following user(s) said Thank You: [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#233179](#233179) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233179 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Can't get tax value on product display page (show_tabular).

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#233183](#233183) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233183 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

On the product page, the product data already has the price with taxes calculated.
You can easily display it like that: Code:

echo $this-&gt;element-&gt;prices[0]-&gt;price_value_with_tax;

The following user(s) said Thank You: [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")**
- [![mypetfly's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39734-mypetfly "View mypetfly's Profile") Topic Author
- [ Offline](/forum/user/39734-mypetfly)

Less More

- Posts: 73
- Thank you received: 2
-
-

10 years 7 months ago [\#233532](#233532) by [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")  Replied by *[mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233532 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

How can I get in after_end.php full price that user paid (including shipping, tax)?
Does $this-&gt;order-&gt;order_full_price contain shipping?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 7 months ago [\#233533](#233533) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#233533 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

Yes, it contains everything.

The following user(s) said Thank You: [mypetfly](/forum/user/39734-mypetfly "View mypetfly's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")**
- [![FilipHradil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36153-filiphradil "View FilipHradil's Profile")
- [ Offline](/forum/user/36153-filiphradil)

Less More

- Posts: 217
- Thank you received: 4
-
-

10 years 2 months ago [\#247605](#247605) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#247605 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hello Nicolas,

please, could you explain this more detailed?
Code:

2. You need to add your javascript code to the beginning of the $this-&gt;ajax variable in the file "quantity" of the view "product". That way, your javascript will be added automatically to the onclick code of the button.

On what line and how can I add javascript?

I tried this
line 35

$this-&gt;ajax = '&lt;script&gt; example&lt;/script&gt;' + return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1,0,\'cart\','.$module_id.')';

But it is probably wrong

Thank you in advance
Filip

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 2 months ago [\#247607](#247607) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#247607 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

That's indeed wrong. As I said, this code will be added in the onclick attribute of your add to cart button.
So you only need to add your javascript.
For example, the code: Code:

$this-&gt;ajax = 'alert(\'test\'); return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1,0,\'cart\','.$module_id.')';

will add an alert popup with the text "test" when you click on the add to cart button.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")**
- [![FilipHradil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36153-filiphradil "View FilipHradil's Profile")
- [ Offline](/forum/user/36153-filiphradil)

Less More

- Posts: 217
- Thank you received: 4
-
-

10 years 2 months ago [\#247835](#247835) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#247835 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Thank you for reply Nicolas.

I tried it at first with alert, it didn't show.

After that I tried it with fbq function, what is defined in my index.php, but page with product says that it is undefined. Can I force loading it for product / quantity view?

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4077
-
- [](http://obsi.dev)
-

10 years 2 months ago [\#247937](#247937) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#247937 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

Here a screenshot from your website:
[ pasteboard.co/abzdtbUxB.png](http://pasteboard.co/abzdtbUxB.png)

As you can see, the custom JS is right included and will be called on the "onclick" event.
I dynamically modify the content of the "onclick" to add an alert and I right got the alert by clicking on the button.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")**
- [![FilipHradil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36153-filiphradil "View FilipHradil's Profile")
- [ Offline](/forum/user/36153-filiphradil)

Less More

- Posts: 217
- Thank you received: 4
-
-

10 years 2 months ago [\#248949](#248949) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#248949 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hello,

sorry but I don't see this code here. I really doesn't work for me. I tried to clean website cache and browser cache but there's still default onclick code.

F.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

10 years 2 months ago [\#248967](#248967) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Integration of Facebook Pixel and other scripts](/forum/36-reports-statistics/882935-integration-of-facebook-pixel-and-other-scripts#248967 "-- url of the page with the problem -- :   travelsat.com.au/shop/satellite-dishes/product/minimax75-dish  -- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 41.0.2 -- Error-message(debug-mod must be tuned on) -- : No message  Hello, I am integrating hikashop with facebook pixel and Google Analytics Dynamic Remarketing and need your help with setting this up.  1. How to get price on product page (view show&#95;tabular). I need to insert this variable into Google Analytics Dynamic Remarketing script. And how to get product ID? Is it $this-&gt;element-&gt;main-&gt;product&#95;id ?  2. How to add onlick event to add to cart button?  In the file administrator/components/com&#95;hikashop/helpers/cart.php I see this line:  $html= '';  I need to add custom script for onclick event. This code is:   var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'cart', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   ecomm&#95;prodid is product id ecomm&#95;totalvalue is price&#42;quantity (there is a quantity box on the page)  I see currently there is alredy exist onclick event for add to cart button (I see script in browser). But when I add change mentioned line in cart.php to smth like this:  $html= '';  this erases previous script for add to cart button and this button doesn't work well. How to combine my script with the script, that I see in browser currently:    3. Also how i can get values mentioned in question (2) in cart.php? ecomm&#95;prodid is product id ecomm&#95;totalvalue is product&#95;price&#42;quantity (there is a quantity box on the page)  4. I need to insert this code on after&#95;end view file:    var dataLayer = window.dataLayer || &#91;&#93;; dataLayer.push({ 'event': 'fireRemarketingTag', 'google&#95;tag&#95;params': { 'ecomm&#95;pagetype': 'purchase', 'ecomm&#95;prodid': '', 'ecomm&#95;totalvalue': } });   Here is ecomm&#95;prodid is array of products IDs, like: 'ecomm&#95;prodid': &#91;123, 456, 789&#93;,  'ecomm&#95;totalvalue' - order price (sum of all prices for products in the order)  How can I get values for ecomm&#95;prodid and ecomm&#95;totalvalue?")*

Hi,

What do you mean by "I don't see this code here" ?
How come you say that you still see the default onclick code ?
Please provide a screenshot for what you're saying because I too, like Jerome, see your code in the onclick of the add to cart buttons on your own website: [ take.ms/W4APC](http://take.ms/W4APC)
So we can't help for something that already works...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODI5MzUtaW50ZWdyYXRpb24tb2YtZmFjZWJvb2stcGl4ZWwtYW5kLW90aGVyLXNjcmlwdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.128 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
