Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Facebook Pixel Code for X-Cart 5

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-07-2015, 12:02 AM
 
star3010 star3010 is offline
 

Member
  
Join Date: Jul 2015
Posts: 11
 

Default Facebook Pixel Code for X-Cart 5

i try to place the Facebook Pixel Code following in xcart 5:
but he page show "Internal error. Contact the site administrator."
can someone help , thanks!

Quote:
{literal}
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=f unction(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(argum ents)};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');

fbq('init', '167819826902607');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=167819826902607&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
{/literal}
__________________
ivan lau

Last edited by seyfin : 03-18-2016 at 09:03 AM.
Reply With Quote
  #2  
Old 11-07-2015, 12:27 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Bing conversion code

You should adjust your code and add a space character after each { character.

Besides, for X-Cart 5, you do not need to use {literal} and {/literal} tags.

So, for X-Cart 5, your code should look like this:

Code:
<!-- Facebook 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(argum ents)};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'); fbq('init', '167819826902607'); fbq('track', "PageView");</script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=167819826902607&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code -->

====

You can use the "Custom Skin" module, in order implement your custom code in X-Cart templates:

1) If your tracking code needs to be added in the <head> section of X-Cart pages, you should implement the code in a copy of the default template file:

skins/default/en/header/body.tpl template file => skins/custom_skin/default/en/header/body.tpl

2) If your tracking code needs to be added before the closing </body> tag, you should implement the code in a copy of the default template file:

skins/default/en/body.tpl template file => skins/custom_skin/default/en/body.tpl

Alternatively, custom template modifications can be implemented using the Webmaster mode feature and Theme tweaker module (Using Webmaster Mode in X-Cart 5).

See also:
* http://kb.x-cart.com/display/XDD/Developer+docs
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart

Last edited by seyfin : 03-18-2016 at 09:02 AM.
Reply With Quote

The following 2 users thank seyfin for this useful post:
star3010 (11-10-2015), totaltec (03-21-2016)
  #3  
Old 11-10-2015, 01:46 AM
 
star3010 star3010 is offline
 

Member
  
Join Date: Jul 2015
Posts: 11
 

Default Re: Bing conversion code

Thanks for your reply.
May I know how to add following code in the product page 's header?

fbq('track', 'ViewContent', {
content_ids: ['1234'],
content_type: 'product',
value: 0.50,
currency: 'USD'
});

how to check it is product page?? sth like this {if $main eq "product"} ???
__________________
ivan lau
Reply With Quote
  #4  
Old 03-18-2016, 07:21 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Bing conversion code

Quote:
Originally Posted by star3010
May I know how to add following code in the product page 's header?

fbq('track', 'ViewContent', {
content_ids: ['1234'],
content_type: 'product',
value: 0.50,
currency: 'USD'
});

how to check it is product page?? sth like this {if $main eq "product"} ???

Check this article:
* How to add Facebook Pixel Сode to X-Cart pages

See also:
* Facebook Pixel Setup
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #5  
Old 03-29-2016, 04:09 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Facebook Pixel Code following in xcart 5

My client's SEO people want him to place is Facebook Pixel Code along with the following "Standard Events"

Where do I place these events?
Standard Events
Add standard events to your code to track specific types of actions on your website. Copy the code for the type of event you want to measure, and paste it below the pixel code on the relevant page within a <script> tag. Keep in mind standard event codes are case-sensitive. Learn more about conversion tracking.

// ViewContent
// Track key page views (ex: product page, landing page or article)
fbq('track', 'ViewContent');


// Search
// Track searches on your website (ex. product searches)
fbq('track', 'Search');


// AddToCart
// Track when items are added to a shopping cart (ex. click/landing page on Add to Cart button)
fbq('track', 'AddToCart');


// AddToWishlist
// Track when items are added to a wishlist (ex. click/landing page on Add to Wishlist button)
fbq('track', 'AddToWishlist');


// InitiateCheckout
// Track when people enter the checkout flow (ex. click/landing page on checkout button)
fbq('track', 'InitiateCheckout');


// AddPaymentInfo
// Track when payment information is added in the checkout flow (ex. click/landing page on billing info)
fbq('track', 'AddPaymentInfo');


// Purchase
// Track purchases or checkout flow completions (ex. landing on "Thank You" or confirmation page)
fbq('track', 'Purchase', {value: '1.00', currency: 'USD'});


// Lead
// Track when a user expresses interest in your offering (ex. form submission, sign up for trial, landing on pricing page)
fbq('track', 'Lead');


// CompleteRegistration
// Track when a registration form is completed (ex. complete subscription, sign up for a service)
fbq('track', 'CompleteRegistration');
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #6  
Old 03-29-2016, 09:04 PM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Facebook Pixel Code following in xcart 5

Would you like to implement the code for X-Cart 4 or for X-Cart 5?
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #7  
Old 03-30-2016, 02:46 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Facebook Pixel Code following in xcart 5

This is for Xcart 5
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #8  
Old 03-30-2016, 05:42 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Facebook Pixel Code following in xcart 5

Please check this article in our Knowledge Base:

* How to add Facebook Pixel Сode to X-Cart pages

You can find examples there, how to implement the code to track some of the events:

- 'ViewContent'
- 'InitiateCheckout'
- 'Purchase'
- 'Search'

If you need to track other events (like 'AddToCart', 'AddToWishlist', 'AddPaymentInfo', 'Lead', 'CompleteRegistration'), then more complex custom modification of the X-Cart 5 code is needed.
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #9  
Old 04-01-2016, 12:27 PM
 
risabb risabb is offline
 

Advanced Member
  
Join Date: Mar 2007
Posts: 75
 

Default Re: Facebook Pixel Code following in xcart 5

Hi Sergey, Will these instructions work for Xcart version 4.0.19? I want to put the FB pixel code into the <head> of my checkout page.

Right now, the only place I know where to put info into the <head> is under customer/home.tpl.

Thanks.

Risa
__________________
Risa
X-Cart ver. 4.0.19 GOLD
Reply With Quote
  #10  
Old 04-03-2016, 09:55 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Facebook Pixel Code following in xcart 5

Hi Risa,

Unfortunately, the instructions won't work in X-Cart 4. These are for X-Cart 5 only.
Here is another user asking for the same: https://forum.x-cart.com/showthread.php?t=73804

In X-Cart 4 you have to edit template files to get the code injected into pages.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 04-04-2016 at 08:47 PM.
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:36 AM.

   

 
X-Cart forums © 2001-2020