WCA/Conversion pixel for desktop and mobile websites Sending conversion pixel ID from your desktop and mobile website to Facebook 5.. First type of Facebook pixels • Website Custom Aud
Trang 1Facebook Pixels
Trang 2How does this work? WCA/Conversion pixel for desktop and mobile websites
Sending conversion pixel ID from your desktop and mobile website to Facebook
5 HTTP(s) Get/Post request to facebook.com/tr + FR Cookie
3 Set FB (FR) cookie
Set FB cookie upon visiting facebook.com or m.facebook.com
2 HTTP(S) to facebook.com or m.facebook.com
6 Empty 1x1 image (pixel)
Trang 3First type of Facebook pixels
• Website Custom Audience pixel (WCA pixel)
• Pixel fired when users visit the client’s website and take specific actions
• Used to create custom audiences of users
• Re-marketing, exclusion targeting and lookalike audience creation purpose
Trang 4Passing data using the WCA pixel
• Event names can be customized (the default is “PixelInitilized”)
• Set the event if the page/tags container URL can’t be used to
distinguish between page/action types or actions are being sent dynamically (e.g button click)
• Parameters (using a key/value dictionary), should be passed on possible and relevant (e.g product ID, Flight Destination etc.)
Trang 5WCA pixel code (generated by PE/AM)
<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;
}
_fbq.push(['addPixelId', ’<PIXEL_ID>']);
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', 'PixelInitialized', {}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none"
src="https://www.facebook.com/tr?
id=<PIXEL_ID>&ev=PixelInitialized" /></noscript>
JS code for JS enabled browsers
Non JS code for
JS disabled browsers
Trang 6WCA pixel - Set event name + Pass explicit parameters
<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;
}
_fbq.push(['addPixelId', '<PIXEL_ID>']);
})();
window._fbq = window._fbq || [];
window._fbq.push(["track", ”StartBooking", {destination: dest}]);
</script>
<noscript><img height="1" width="1" border="0" alt=""
style="display:none" src="https://www.facebook.com/tr?
id=<PIXEL_ID>&ev=StartBooking&cd[destination]=dest" /></
noscript>
Trang 7Second type of Facebook pixels
• Conversion pixel
• Report on conversions to Facebook in order to track actions that are taken offsite
• Conversion – can be any action taken on the client’s website, e.g registration, lead, purchase etc
• The tracking is used for:
• Measurement and reporting – report on actions that are attributed to Facebook ads
• Bid on oCPM for actions that are taken offsite
• Create Lookalikes audiences
• Cross device conversion tracking
• Multiple conversion pixel IDs per ad account
Trang 8Passing data using the Conversion pixel
• The pixel ID is mapped on Facebook server side to an ad account + conversion event (e.g “purchase", "registrations”)
• By default, only the pixel ID is being passed
• Optional parameters that can be passed: currency and conversion value
Trang 9Conversion pixel code (generated by PE/AM)
<! Facebook Conversion Code for test >
<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', ’<CONV_PIXEL_ID>',
{'value':'0.00','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://
www.facebook.com/tr?
ev=<CONV_PIXEL_ID>&cd[value]=0.00&cd[currency]=USD&noscript=1" /
></noscript>
JS code for
JS enabled browsers
Non JS code for JS disabled browsers
Trang 10JS vs Image pixel
WCA/Conversion pixels can be implemented in two ways:
1 Java Script pixel code is preferred:
• Recognizes the original page URL for the most of the tag mangers
• Asynchronous loading (better site performance)
• Flexible/dynamic (e.g send WCA event when clicking on ‘add to basket’ button)
2 Image pixel code – should be used only in a case where the client
does not allow adding JS code to their site or within a tag managers which does not support JS code
Trang 11WCA / Conversion pixel best practices
1 Place the pixels on both of your desktop and mobile web sites
2 Use the JS version of the pixel code
3 Place the pixels in the <head> </head> HTML section
4 For clients with a small-medium traffic volume, place the WCA pixel
on all of the site’s pages
Trang 12Cont… Conversion pixel best practices
1. Use the Facebook pixel helper extension in chrome and chrome
developer tools - mobile emulator to verify pixel fires across devices
2. Pass conversion values & Currency from the pixel
3. Track all of the relevant conversion pixels for ALL of your Facebook ads
– for cross device measurement!
4. Use oCPM bidding for offsite conversions
Trang 13Reference
• Pixel helper Plugin:
https://developers.facebook.com/docs/ads-for-websites/pixel-troubleshooting
• WCA pixel:
https://developers.facebook.com/docs/ads-for-websites/website-custom-audiences/planning#how-to-place
• Conversion pixel:
https://developers.facebook.com/docs/ads-for-websites/drive-conversions/#install-pixel
• Pixel sample: http://fb-pixel-sample.herokuapp.com/