Archived topic
Facebook Pixel using Elements
5 replies · Started by JC on April 16, 2019
Heya, so I'm setting up my FB pixel again. it was firing but all of a sudden, it's not showing up in my Chrome extension and when I look at the code, I'm not seeing it there either.
I'm following these steps:
> Add new element
> Choose element type: header
> paste the Pixel code
> Display Rules: Entire Site
> save
This has worked for my Google Anal code but for some reason, I cannot get it to work for the FB pixel.
Am I missing something?
I've tried purging the cache a bunch, too.
Hi there,
instead of the Header Element use the Hook Element. Within that you should select the WP_head hook.
alrighty -- just did that and it's working now.
but here's my next question... why is this working with my Google analytics code with the previous instructions, and why would you pick the Hook version over the Header element?
Google is probably a little more flexible shall we say.
These types of scripts have to be added between the <head></head> tags of the website. This is where the WP_head hook is and is provided for exactly that.
The Header Element is for adding content to the page and shouldn't be used for adding scripts, links or other types of meta data.
thanks. very good to know. I'll go make those changes to my google scripts!
Glad to be of help.