Track customers coming from Facebook Ads

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeTrack customers coming from Facebook Ads

This topic has been marked as not resolved.

Hi,

We’ve been asked to add the following code between head … /head after successfull transactions, so we can track customers coming from FB ads:

var fb_param = {};
fb_param.pixel_id = ’6126127243264′;
fb_param.value = ’0.00′;
(function(){
var fpw = document.createElement(‘script’);
fpw.async = true;
fpw.src = (location.protocol==’http:’?'http’:'https’)+’://connect.facebook.net/en_US/fp.js’;
var ref = document.getElementsByTagName(‘script’)[0];
ref.parentNode.insertBefore(fpw, ref);
})();

Since, the head … /head part of the webpage is constructed inside shoppica2\template\common\header.tpl, which is included in all pages we can not incorporate it there. Instead, we’ve created the following vqmod:

<![CDATA[]]>
<![CDATA[

var fb_param = {};
fb_param.pixel_id = '6126127243264';
fb_param.value = '0.00';
(function(){
var fpw = document.createElement('script');
fpw.async = true;
fpw.src = (location.protocol=='http:'?'http':'https')+'://connect.facebook.net/en_US/fp.js';
var ref = document.getElementsByTagName('script')[0];
ref.parentNode.insertBefore(fpw, ref);
})();

]]>

Would that be OK?

Thank you!

  • This reply was modified 4103 days ago by  devplus.
  • This reply was modified 4103 days ago by  devplus.
February 6, 2013 at 5:58 pm #18254

Hi,

As far as the code you need to put is correct, there shouldn’t be any problem :)

Best,
ThemeBurn team

February 11, 2013 at 5:40 pm #18560
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.