11 / 11
Feb 2014

I looked through the guide and saw you guys recommend the following for third party tracking pixels:



function EJEJC_config() {

EJEJC_BEACON = "http://Put.Tracking.Pixel.or.Beacon.URL.Here";

}



However, Facebook gives me:



<script type="text/javascript">

var fb_param = {};

fb_param.pixel_id = '6011344881255';

fb_param.value = '0.00';

fb_param.currency = 'USD';

(function(){

var fpw = document.createElement('script');

fpw.async = true;

fpw.src = '//connect.facebook.net/en_US/fp.js';

var ref = document.getElementsByTagName('script')[0];

ref.parentNode.insertBefore(fpw, ref);

})();

</script>

<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/offsiteevent.php?id=6011344881255&value=0&currency=USD" /></noscript>



What's the best way to track Facebook ads that drive conversions?



Thanks

  • created

    Jul '13
  • last reply

    Feb '14
  • 10

    replies

  • 2.1k

    views

  • 5

    users

  • 10

    links

21 days later

Sorry but I'm being dense. Where is this code in your system? how do I get there? I have Facebook ads running and want to know which of them are converting.



Regards, Steve Price

6 months later

So, I get that the URL should go in the 'BEACON' section, but what about the rest of the script facebook generates mentioned in the original post. Does that part still go in the <head> or is all you need the link in the beacon section? Thanks

You would actually discard the rest of the code. The beacon is the important part and it can be handled within our cart code.

Unfortunately it doesn't show up as verified if I'm just using the beacon. Here is the code I have (I've replaced the URL for privacy purposes here).



Is this correct?



<script language="javascript" type="text/javascript">

<!--

function EJEJC_lc(th) { return false; }

function EJEJC_config() {

EJEJC_BEACON = "https://www.facebook.com/offsiteevent.php?id=MYID&value=0&currency=USD";

EJEJC_WIDTH = 770;

EJEJC_HEIGHT = 520;

EJEJC_POSTCALL=true;

}

function EJEJC_shown() {

jQuery("#imgHeader").attr("src", "http://MYSITE.com");

jQuery("#btnCC").attr("src", "http://MYSITE.com");

jQuery("#btnPP").attr("src", "http://MYSITE.com");

}

// -->

</script>

<script src='http://www.e-junkie.com/ecom/box.js' type='text/javascript'></script>

In that case, you can disregard using the EJEJC_BEACON method, and instead just paste FB's tracking code into your E-junkie thank-you pages.



To have this code inserted on every thank-you page we generate for you, regardless of what item(s) the buyer purchased, paste it into Seller Admin > Account Preferences > Common Thank-you Page HTML.



To have the code inserted only when certain items are purchased, or to insert different codes for different items, paste it into the "Message (HTML)" field of the relevant product's settings.



In case you're redirecting to a Common Thank-you Page URL on your site, see the instructions here:

2http://www.e-junkie.com/ej/tips.tracking.conversions.htm2

Thanks, but unfortunately that won't work as what I'm trying to track is add-to-carts. I already have the Thank You page code input to test conversions.



Any ideas?

Ah sorry, this thread started as an inquiry about tracking conversions from Facebook ads, and you didn't mention otherwise, so that's what we thought you were trying to accomplish.



The only way of tracking cart button clicks that we support would be via Google Analytics, if you use our version of the GA tracking code (see http://www.e-junkie.com/ej/help.tracking.htm), but this probably would not be relevant to tracking clicks in association with Facebook ads.



In theory, it may be possible to replace the standard onClick= JS call in our cart button codes with a custom call to some function that tracks the click and then calls our standard function that adds the item to cart -- or even leave the onClick= event as-is and have your custom tracking JS recognize clicks on elements with class="ec_ejc_thkbx" -- but providing more specific instructions to accomplish that is beyond the scope of support we can provide. The Developer Directory link at the top of our site lists competent, E-junkie-experienced developers available for hire to perform custom work.

Ah, sorry I wasn't clear. That's a real bummer as it makes it difficult to advertise to segments other than existing customers using Facebook.



I'll look into a developer to see if it's possible. Thanks.