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

Facebook Pixel Code for X-Cart 4
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 04-04-2016, 11:03 AM
 
1cp 1cp is offline
 

Member
  
Join Date: Jan 2006
Posts: 21
 

Default Facebook Pixel Code for X-Cart 4

I am using x-cart 4.6.3 with the reboot responsive template.

I need to install the facebook pixel code to track my ads but need help as to which file to put it in.

It needs to be pasted "between the <head> and </head> in your website code."

I'd also like to add the code for standard events, like

// ViewContent
// Search
// AddToCart
// InitiateCheckout
// Purchase
// Lead

but again, not sure which files/templates to put the code on.

Would appreciate some help. I am not a technical person, so please be as detailed as possible in your instructions.

Thanks in advance.
__________________
version 2.1
Reply With Quote

The following user thanks 1cp for this useful post:
TRJones (07-03-2017)
  #2  
Old 04-05-2016, 11:37 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,825
 

Default Re: Facebook Pixel Code for X-Cart 4

In Reboot:
/reboot/custom/reboot_service_head.tpl

At the bottom of this file I added:
Code:
{include file="custom/facebook_tracker.tpl"}

Then I created the file:
/reboot/custom/facebook_tracker.tpl

With the content:
Code:
{literal} <!-- 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(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'); fbq('init', 'REDACTED'); fbq('track', "PageView"); {/literal} {if $main eq "cart"} fbq('track', 'InitiateCheckout'); {/if} {literal} </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=REDACTED&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code --> {/literal}

Of course be sure to enter your pixel code where I wrote "REDACTED" above.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following 6 users thank totaltec for this useful post:
1cp (04-08-2016), elmirage001 (04-09-2016), Kman (04-05-2016), PhilJ (04-05-2016), seyfin (04-15-2016), TRJones (07-03-2017)
  #3  
Old 04-08-2016, 11:15 PM
 
1cp 1cp is offline
 

Member
  
Join Date: Jan 2006
Posts: 21
 

Default Re: Facebook Pixel Code for X-Cart 4

Thank you so much!

Could you also advise me on where to put the google conversion code? the instructions say to put it on the thank you or equivalent page, between the <body</body> tags.
__________________
version 2.1
Reply With Quote
  #4  
Old 04-09-2016, 05:43 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,825
 

Default Re: Facebook Pixel Code for X-Cart 4

Quote:
Originally Posted by 1cp
Could you also advise me on where to put the google conversion code? the instructions say to put it on the thank you or equivalent page, between the <body</body> tags.
I believe you want to look in customer/main/order_message.tpl

-Mike
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 07-08-2016, 01:40 AM
 
magicant magicant is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Manchester UK
Posts: 58
 

Default Re: Setting up Facebook conversion Tracking in Checkout??

Can anybody advise on the exact code to use for facebook tracking pixel on order_message ?

I am sure the code facebook provides needs altering to pickup the final values in x-cart?

Many thanks
All the best
Anthony
__________________
X-Cart Version: 4.7.6
PHP 5.3.29
MySQL server 5.6.29
MySQL client 5.6.29
Reply With Quote
  #6  
Old 07-08-2016, 02:08 AM
 
magicant magicant is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Manchester UK
Posts: 58
 

Default Re: Facebook Pixel Code for X-Cart 4

I will try this for the facebook pixel..

Does anybody know what exactly the code is I should enter for Facebook Conversion Tracking pixel into the Order_message page?

I am sure the code facebook provides needs to be amended to work and pick up the order values at the end but cannot find any instructions on how to do this.

Please can someone advise?


Many thanks
Anthony
__________________
X-Cart Version: 4.7.6
PHP 5.3.29
MySQL server 5.6.29
MySQL client 5.6.29
Reply With Quote
  #7  
Old 07-08-2016, 04:41 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,825
 

Default Re: Facebook Pixel Code for X-Cart 4

Anthony,
I'm pretty sure you need to add the goal in your Pixel setup. Can you find any documentation from FB about passing order values? I just looked and couldn't find it easily.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #8  
Old 07-10-2016, 01:36 PM
 
magicant magicant is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Manchester UK
Posts: 58
 

Default Re: Facebook Pixel Code for X-Cart 4

The only thing I can see in my pixel account is the following code for my pixel.. but i'm guessing the x-cart values and such must need custom code adding into the below code to make it work correctly.

I have found documentation from x-cart for version 5 for conversion but nothing anywhere for version 4.

Many thanks
Anthony

// 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');

// Other
//
fbq('track', 'Other');
__________________
X-Cart Version: 4.7.6
PHP 5.3.29
MySQL server 5.6.29
MySQL client 5.6.29
Reply With Quote
  #9  
Old 07-11-2016, 05:09 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,825
 

Default Re: Facebook Pixel Code for X-Cart 4

Anthony,
Oh I see. Yes this would need to be integrated into the order message page. I'd like to work on this for you, if you are interested drop me a line.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #10  
Old 07-12-2016, 10:00 AM
 
magicant magicant is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: Manchester UK
Posts: 58
 

Default Special Facebook Pixel Code Being Minified

Hi Guys..

I am trying to include the exact code below.

I have setup a facebook_tracker.tpl and referenced it inside reboot_service_head.tpl

It is showing up in google chrome but not all of the pixel is loading correctly.

The tech support team from the special pixel code says the following:

========
Our developer checked your site, and it seems you've "minified" our JS file (to make it smaller). However, because of that it stopped working. Please make sure to use our original code, without minimizing it. That should do the trick!
========

If this means it is shrinking the js file how can I make sure it does not?

They explain to use the Facebook Pixel Helper Chrome plugin to detect if alright or not. it's installed at: www.magicworld.co.uk/magic-shop/

Many Thanks - can't wait to fix

Anthony

{literal}
=========PIXEL START=========
<script type='text/javascript' src='https://connectio.s3.amazonaws.com/script.js'></script><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', '175682379449572');
fbq('track', 'PageView');
/* page visit*/
fbq('trackCustom', 'connectretarget', {
magicworld_visitcounter: bpixelcookie
});
/* URL */
fbq('trackCustom', 'connectretarget', {
magicworld_URL : window.location.href
});
/*page timer*/
CR_pagetimer('connectretarget', count);
fbq('trackCustom', 'connectretarget', {
magicworld_date : now
});
fbq('trackCustom', 'connectretarget', {
magicworld_language : userLang
});
fbq('trackCustom', 'connectretarget', {
magicworld_visiting_device : device_name
});
fbq('trackCustom', 'connectretarget', {
magicworld_session_count : session_variable
});
/* page scroll */
window.onscroll = function() {
checkScroll();
};
function CR_pagescroll(event, value)
{
fbq('trackCustom', event,{
magicworld_pagescroll : value });
}
function CR_utmsource(event, value)
{
fbq('trackCustom', event,{
magicworld_utmsource : value });
}
function CR_utmmedium(event, value)
{
fbq('trackCustom', event,{
magicworld_utmmedium : value });
}
function CR_utmcampaign(event, value)
{
fbq('trackCustom', event,{
magicworld_utmcampaign : value });
}
function CR_pagetimer(event, value)
{
window.setInterval(function(){
count = count + 20;
fbq('trackCustom', event, {
magicworld_pagetimer : count
});
}, 20000);
}fbq('trackCustom', 'connectretarget', {
magicworld_source : referrer
});</script>
{/literal}
__________________
X-Cart Version: 4.7.6
PHP 5.3.29
MySQL server 5.6.29
MySQL client 5.6.29
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 09:03 AM.

   

 
X-Cart forums © 2001-2018