Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Facebook Pixel Dynamic Events Rate Topic   * * * * - 1 votes

 
  • tzifman
  • Newbie
  • Members
  • Join Date: 23-Apr 14
  • 11 posts

Posted 12 February 2016 - 08:52 AM #1

Hello 

 

i am trying to configure facebook dynamic events on my site. I have installed Pageview event that works great on all pages. 

 

Only on product pages i need to insert that code: 

 

<!-- Custom Audience Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
// Insert Your Custom Audience Pixel ID below.
fbq('init', '<FB_PIXEL_ID>');
fbq('track', 'PageView');
fbq('track', 'ViewContent', {
content_name: 'Really Fast Running Shoes',
content_category: 'Apparel & Accessories > Shoes',
content_ids: ['1234'],
content_type: 'product',
value: 0.50,
currency: 'USD'
});
</script>

 

Content_name, Content_Category, Content_Ids and Value must be variables. I have tried almost anything but it doesnt work. For example i tried: 

content_name: '{/literal}{$item.product}{literal}',

content_ids: ['{/literal}{$product_id}{literal}'],

value: '{$item.price}',

<?php echo $product_id; ?>

 

 

but nothing worked. 

 

Could you help me? 

 

Thanks in advance

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 12 February 2016 - 02:52 PM #2

Looks like the code was added to the Product details page? Add the following code to see the content of the $product array

{$product|fn_print_r}

for this code will show product ID,

{$product.product_id}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 16 April 2016 - 07:33 AM #3

Hello 

 

i am trying to configure facebook dynamic events on my site. I have installed Pageview event that works great on all pages. 

 

Only on product pages i need to insert that code: 

 

<!-- Custom Audience Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
// Insert Your Custom Audience Pixel ID below.
fbq('init', '<FB_PIXEL_ID>');
fbq('track', 'PageView');
fbq('track', 'ViewContent', {
content_name: 'Really Fast Running Shoes',
content_category: 'Apparel & Accessories > Shoes',
content_ids: ['1234'],
content_type: 'product',
value: 0.50,
currency: 'USD'
});
</script>

 

Content_name, Content_Category, Content_Ids and Value must be variables. I have tried almost anything but it doesnt work. For example i tried: 

content_name: '{/literal}{$item.product}{literal}',

content_ids: ['{/literal}{$product_id}{literal}'],

value: '{$item.price}',

<?php echo $product_id; ?>

 

 

but nothing worked. 

 

Could you help me? 

 

Thanks in advance

Were you able to make it work ?


Warm Regards,
Admin | MVE: 4.2.4

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 16 April 2016 - 07:38 AM #4

 

Looks like the code was added to the Product details page? Add the following code to see the content of the $product array

{$product|fn_print_r}

for this code will show product ID,

{$product.product_id}

Nothing is displayed on using this , it seems this variable is not accesible on the Product Detail page in the layout.


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 18 April 2016 - 08:09 AM #5

Did you clear the cache?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 18 April 2016 - 09:41 AM #6

Did you clear the cache?

 

I am adding this code on Design LAyouts > Location : Proucts > Custom HTML but its not showing the values. It just print it directly.

 

view-source:http://www.fleaffair...ull-saree.html 


Warm Regards,
Admin | MVE: 4.2.4

 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 18 April 2016 - 10:32 AM #7

I am adding this code on Design LAyouts > Location : Proucts > Custom HTML but its not showing the values. It just print it directly.

 

view-source:http://www.fleaffair...ull-saree.html 

It worked thanks. Can you tell me how can I print the category in text from $product.category_ids


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 18 April 2016 - 02:33 PM #8

Try

{foreach from=$product.category_ids item=c}
    {$c|fn_get_category_name}
{/foreach}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 19 April 2016 - 05:45 PM #9

It worked thanks.


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 20 April 2016 - 07:36 AM #10

It worked thanks.

 

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • mokeshop
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 1009 posts

Posted 20 April 2016 - 07:41 AM #11

Where we can get the complet product data array names?

Regards

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 20 April 2016 - 07:50 AM #12

Where we can get the complet product data array names?

Regards

 

Please clarify your question


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 20 April 2016 - 08:04 AM #13

Where we can get the complet product data array names?

Regards

 

 

Use this in the tpl file.

....
{/literal}
{$product|fn_print_r}{literal}
....

Warm Regards,
Admin | MVE: 4.2.4