7 ms·
A guide to using the Facebook Pixel
- palmdeezy 10y agoThis is a great overview. I find it interesting that there is still significant friction with setting up arguably one of FB's most useful ad tools....I also find it interesting that tracking pixels pretty much haven't changed since the late 90s.
- kripy 10y agoOut of the box, all you need to do is drop the default code onto your web page and it will call the 'PageView' event. Pretty much the same deal as Google Analytics (and Twitter also have their own version). @palmdeezy has taken it a little further to include extra metadata in order to segment website visitors. And I agree that these snippets have been around for a while but how else could you facilitate passing data back to ad exchanges? JavaScript seems to be the perfect tool to get the scale required to handle these types of interactions.
- martin_a 10y agoI appreciate your post. Good insight on the "how to" and it surely got me motivated to have a look into this.
- yeldarb 10y agoI'm interested in how this works with your business model. Do you charge job posters extra to get wider distribution (or more budget) on the ad you are running for them? Or is this more of a growth hack to simulate having more organic traffic flow on your site?
- zappo2938 10y agoThere is no business model. I'm a yacht chef who decided to learn to code JavaScript. This site is just something to put in my portfolio.
- kuschku 10y agoThis, btw, is where the EU cookie law applies, and what it was intended to prevent. You can not embed that tracking pixel without first having approval from the user. (This – third party cookies for tracking – is the entire reason the damn law was written in the first place, and yet we still haven’t gotten rid of them).
- zappo2938 10y agoInteresting. I'm new to this. What do I need to know to make this legal?
- kuschku 10y agoSimply, you first present the user with a dialog asking them for approval to track them, (and you have to make that explicit), and only once given approval, you actually load the tracking code from Facebook, and interact with their third-party cookies. If the user says no, well, just redirect to Google, or something – but you can’t load or set that tracking data before the user has clicked "Yes, I agree", and you can’t hide the fact that users are actively tracked in the ToS or somewhere. If you don’t care about breaking european law, you can just leave the tracking there, never asking the user, but, well, you’re breaking european law then.
- deanclatworthy 10y agoHas anyone actually been prosecuted for this? I can imagine that in Germany they might follow up on this but elsewhere in Europe I see plenty of sites not informing users.
- kuschku 10y agoActually, yes. And, yes, it was in Germany. And it was in fact for using Facebook tracking pixels and "like" buttons by large newspapers. Which is why every newspaper then switched to "2-click Like", where the Facebook button is first shown in grey, you click it, it loads the actual button, and you can like. It was also recently confirmed in a court case from this year (15'000€ fine for using it): http://www.verbraucherzentrale.nrw/mediabig/239773A.pdf http://www.verbraucherzentrale.nrw/mediabig/239773A.pdf
- warpech 10y agoThis is what sometimes is called a "third party cookie"
- gcb0 10y agowhich you should disable as soon as you install your browser. unless you bought into the Google one. since Google also benefit a lot from 3rd party cookie, it paid Mozilla so they enabled it by default (use to be off by default) and i think recently chrome ever removed the option to disable it. disabling 3rd party cookie is a million times more effective than enabling the joke of the do no track settings in the browser.
- tantalor 10y agoThis setting is in the latest versions of desktop and mobile Chrome.
- joosters 10y agoI think it was very revealing that they never had this setting for a long time, despite it being available in just about every other browser before then...
- martey 10y agoThis isn't true. Chrome launched with a setting called "Restrict how third party cookies can be used" which was almost the same thing: > First-party and third-party cookies can be set by the website you're visiting and websites that have items embedded in the website you're visiting. But when you next visit the website, only first-party cookie information is sent to the website. Third-party cookie information isn't sent back to the websites that originally set the third-party cookies. As far as I can tell, this difference was due to the fact that Chrome (at the time) was a WebKit fork (see https://bugs.chromium.org/p/chromium/issues/detail?id=12969#c6 https://bugs.chromium.org/p/chromium/issues/detail?id=12969#... and https://bugs.chromium.org/p/chromium/issues/detail?id=16658#c9 https://bugs.chromium.org/p/chromium/issues/detail?id=16658#...). Both the comments I mention are from 2009 (less than a year after Chrome was publicly announced). I searched through chromium's source to see if I could figure out when this option/feature changed. I didn't find it, but I find plenty of examples of Chromium developers adding functionality and features to make blocking and monitoring third-party cookies easier. I did find a thread on Hacker News from 2011 (https://news.ycombinator.com/item?id=3034295 https://news.ycombinator.com/item?id=3034295), by which point Chrome's third party cookie blocking was actually stricter than WebKit/Safari due to changes in Chromium's cookie management. Note that the main argument there isn't that Chrome should expose their strict cookie blocking as a setting (their current behavior), but that Chrome should default to Safari's looser handling (which seems similar to Chrome's original "restrict.." setting). It is worth noting that Firefox did eventually implement the latter solution - but two years later, in 2013 (https://blog.mozilla.org/netpolicy/2013/02/25/firefox-getting-smarter-about-third-party-cookies/ https://blog.mozilla.org/netpolicy/2013/02/25/firefox-gettin...). It's possible I have missed something and there is evidence somewhere on the Internet that there was a point where Chromium's handling of third party cookie blocking was significantly different than all other major browsers, but I haven't seen it.
- shostack 10y agoI have found the FB pixel to be both awesome and not fully baked in terms of reporting. The general concept of allowing custom events is awesome. It means it plays really nicely with situations that don't fit nicely into their standard events. By the same token, custom events feel like second class citizens in FB ad reporting. Here is a scenario and I'd love any suggestions if people have them because there is no documentation on this and FB has basically done away with access to a live person for ads (while interestingly enough Google now goes out of its way to connect you with a live person, even if only via chat). I work on a product with a free trial with subscriptions of multiple plan levels and terms. I can track a custom event on subscription and pass plan and term params along with the revenue data, but there is no easy way to drill into those dimensions keyed off of custom params with their reporting. The only manual hack I've found is to create an aggregate custom event for all subscriptions for top level reporting, and then individual custom events for each plan/term permutation (plan1/annual, plan1/monthly, plan2/annual, plan2/monthly, etc.). This is manageable for now as there are only 8 events plus the aggregate one, but I then have to add each of those as custom columns to reports which gets super messy. The not fully baked part is that as an advertiser, my ideal reporting dashboard in FB would let me drill in at multiple levels and segment reporting by these custom dimensions just by using a single custom event's params. So I'd have a report segment option for plan and term that then broke those out in the table and then the chart (and their charting capabilities are also sorely lacking right now for serious advertisers). Instead, I need to dump this to a spreadsheet and pivot it if I want to do any serious analysis. Has the author or anyone else solved for this differently outside of using a PMD with better reporting? We'll end up switching to one soon enough, but I feel like FB has really failed to go the final steps with this. Adding custom parameters but then not allowing advertisers to report and segment by them is a huge opportunity for them. And they clearly have the data parsed already because offer it in the custom conversion and audience builder tools. Also, and this applies to most ad platforms...I wish there were better support for recurring up and LTV tracking and reporting. Helping me easily report on the full deferred value the ads are driving makes it easier for me to build the case for more spend. I can do that in other analytics tools, but I feel like this is data FB would want to have in a structured format. Maybe that's just me though.
- jackgolding 10y ago
- throwaway98237 10y agoAs a consumer I can totally read that and understand what I've given up. Totally.
- kripy 10y agoNice write up! As what you have is a catalogue of sorts you should have a look into Dynamic Product ads: https://www.facebook.com/business/a/online-sales/dynamic-product-ads https://www.facebook.com/business/a/online-sales/dynamic-pro.... This is Facebook's programmatic play which does all the segmentation work in the background.
- deleted 10y ago[deleted]
- soared 10y agoThis is unnecessarily complicated. You can create a custom audience with url definitions and don't need custom events for that. Unless you are using a single page site there's no need to over complicate this with more JavaScript.
- jackgolding 10y agoThis example is a single page site.
- goldfishcaura 10y agoFacebook, Google - people treat their numbers as holy because they have so many smart people working for them (and because they have very good PR departments). But I beg to differ. I think it is about time we have a community investigating these metrics: https://segahm.github.io/adwords_investigators.html https://segahm.github.io/adwords_investigators.html