Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-20-2015 13:04:50

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Facebook tracking pixel

Hi Guys:

I am trying to place a tracking pixel for FaceBook on my Order Summary page.

I know where to find this as it is under System > Displays > Display Includes.

But I need to place this tracking pixel in the head of the document so I need to know the actual name of the file header or some fancy way of inserting it using the program.

Can anyone help?

Thanks.

Offline

 

#2 07-21-2015 06:38:05

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

If it really has to be in the <head>, which it probably doesn't, you'll need to edit your skin.php file for your active skin.  If it doesn't have to be in the head, add the code to the 'Third Party Affiliate Placeholder' include under System > Displays > Display Includes.


Nick Hendler

Offline

 

#3 07-21-2015 09:23:49

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Thanks Nick.

Here is what the Facebook procedure states. Keep in mind I have never advertized on Facebook so I really don't know if this is necessary.

"Copy and paste the following code between <head> and </head> on the page of your website you want to track actions. For example, to track registrations, place the code on your 'registration completed' web page."

I guess I could try as you suggest and see if it works. If not then I can re evaluate this. If I put it on the skin template then I think it would show up on every page that uses that template, which would defeat the purpose anyway. Does that make sense?

I will update the post as I get results.

Thanks again.

Offline

 

#4 07-21-2015 09:32:51

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

It looks like the Third Party Affiliate Placeholder section has placeholders for these common variables.

// | Order Number:         $order['id']
// | Order Amount:         $order['ordertotal']
// | Customer First Name:  $order['fname']
// | Customer Last Name:   $order['lname']
// | Customer Email:       $order['email']

Here is the actual code Facebook wants me to place on the page. I am not sure this is going to work with this routine. This is just a simple self contained javascript.

Does this change your mind as to where to place it?

Thanks again.




<!-- Facebook Conversion Code for facebook conversions -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6034227610306', {'value':'0.01','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6034227610306&amp;cd[value]=0.01&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

Offline

 

#5 07-22-2015 16:51:50

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

Everywhere you see:

0.01

Replace with:

<?php print $this->xhtml_encode($order['ordertotal']); ?>

Doesn't look like they want any more than the amount sent.


Nick Hendler

Offline

 

#6 10-13-2015 11:03:57

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Nick, I am going to try to do this again. I got sidetracked and did not get this done.

I am not sure what file I should be looking for 0.01 in. It is not in the skin.php file.

I also do not see it in the System > Displays > Display Includes area. I looked in the order summary.
and a few others.
So exactly what file do I look in to find 0.01 and then replace it with
<?php print $this->xhtml_encode($order['ordertotal']); ?>

Thank you (as always).

Offline

 

#7 10-14-2015 07:28:10

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

In post #4 you provided the JS code that needs to go in.  That code has '.01' in it for the amount, and you'll want to replace that with:

<?php print $this->xhtml_encode($order['ordertotal']); ?>


Nick Hendler

Offline

 

#8 10-15-2015 10:09:36

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Do I just add it to the 'Display Content' in the  'Third Party Affiliate Placeholder' page.

Do I replace the existing php in the 'Display Content' or do I add this to it.

Thanks for all your help.

Offline

 

#9 10-16-2015 06:34:56

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

You can replace what's there (everything) with the facebook code then insert the order total as instructed into the facebook code.


Nick Hendler

Offline

 

#10 10-16-2015 08:42:00

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Here is the exact code I am using, with the change as you instructed. For anyone who has the same issue as I did. Thanks again Nick.

<!-- Facebook Conversion Code for facebook conversions -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6034227610306', {'value':'<?php print $this->xhtml_encode($order['ordertotal']); ?>','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6034227610306&amp;cd[value]=<?php print $this->xhtml_encode($order['ordertotal']); ?>&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

Offline

 

#11 10-16-2015 09:20:42

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Now they want a pixel tracking piece of code. I believe this is the same thing except now I put in the line of code where I see 0.00.

Is that correct,

And then put in on the same page as the last piece of code? Am I learning?

<!-- Facebook Conversion Code for Checkouts - mynamehere 1 -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6038348513106', {'value':'0.00','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6038348513106&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

Offline

 

#12 10-19-2015 06:28:34

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

Right.  You've got it.


Nick Hendler

Offline

 

#13 10-19-2015 13:08:35

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Hey I tried that and it broke the cart.

The order still went through but it hung at a text line that siad the sale went through.

It did go through, but the cart still hung up.

I took the code out, put in the old boiler plate and it works fine again.

So something in the script is quite disagreeable.

Happy to let you see it if you want.

Tim G.

Here is all the code that I put in except I changed my name as they put it in the pixel script.

<!-- Facebook Conversion Code for facebook conversions -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6034227610306', {'value':'<?php print $this->xhtml_encode($order['ordertotal']); ?>','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6034227610306&amp;cd[value]=<?php print $this->xhtml_encode($order['ordertotal']); ?>&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

<!-- Facebook Conversion Code for Checkouts - My Name 1 -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6038348513106', {'value':'<?php print $this->xhtml_encode($order['ordertotal']); ?>','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6038348513106&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

Offline

 

#14 10-20-2015 06:05:24

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

Use this:

Code:

<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6038348513106', {'value':'<?php print $this->xhtml_encode($order['ordertotal']); ?>','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6038348513106&amp;cd[value]=<?php print $this->xhtml_encode($order['ordertotal']); ?>&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

(I corrected the xhtml_encode() call on all posts above)


Nick Hendler

Offline

 

#15 10-20-2015 10:13:47

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: Facebook tracking pixel

Wow! That worked like a charm.

Gotta go advertise now.

Thanks Nick.

Offline

 

#16 10-21-2015 06:50:56

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19804
Website

Re: Facebook tracking pixel

Tim- What are the options out there for running discount code based incentives through facebook for shares?


Nick Hendler

Offline

 

Board footer