-
AuthorPosts
-
May 1, 2017 at 2:09 am #785445
HI I want to add the facebook pixel code to my website. I’ve looked through the threads and there is lots of different advice about how to do this. What is the latest advice please, as there is a new facebook pixel code since Feb 15 2017. My code in included in private content
Many thanks
Jenny
May 1, 2017 at 3:18 am #785447Hey JennyGr,
You can add the code (in this format) in functions.php (at the bottom):
function add_fb_pixel_code(){ ?> Put Your Facebook Pixel Code Here <?php } add_action('wp_footer', 'add_fb_pixel_code');
The whole code for with you fb pixel code is in private content. Hope this helps :)
Best regards,
NikkoMay 2, 2017 at 12:52 am #786051HI Nikko I was just about to add this then I noticed in Facebook that the pixel code had been installed 8 hours ago and was working, Had you been kind enough to go ahead an install it for me?
Thanks
Jenny
May 2, 2017 at 8:02 am #786204Hi Jenny,
I would gladly do so but I’m afraid it’s not me since I don’t have any admin access to your site. Usually when someone gives their admin access, I add some codes and tell them what I did to fix it. :)
Best regards,
NikkoMay 2, 2017 at 8:33 am #786217Okay thanks Nikki. I checked facebook to see what was going on and it’s actually returning the raw pixel fires from pages at https://kriesi.at/support/ I’mt not sure why it’s doing that?
So I copied the code as you suggested in the php file and it did not work, but instead showed up as code below the footer on my site. Any suggestions?
Thanks
Jenny
May 2, 2017 at 9:04 am #786227Hi,
I just checked the code I gave in private content but it seems some code were missing, try to use the code I have uploaded in pastebin, link in private content. Hopefully that works well :)
Best regards,
NikkoMay 2, 2017 at 11:22 pm #786788HI Nikko I’ve added that code to the functions php.
I’ve tested it in Facebook pixel helper and get the following error. Any advice?
The Facebook pixel code on this page didn’t load, so no information was sent to Facebook.
Facebook’s further advice is
Pixel Did Not Load
This error means that the Pixel Helper found what looks to be Facebook pixel code on your site, but the actual HTTP call was never made.
This could typically due to an error in the code, but could also occur if the pixel fires on a dynamic event (e.g. on a button click).
In that case, the error will disappear upon clicking on the button.
May 3, 2017 at 6:41 am #786921Hi,
Can you give us a link to your site? so we can take a closer look, and also ftp access so I can access the functions.php file (modifying files in the dashboard is a bit risky). Just post the details in Private Content so it’s only visible for moderators.
Best regards,
NikkoMay 21, 2017 at 1:46 pm #797182Hi Nikko I’ve included admin login in the private content. How do i give you FTP access?
Thanks
Jenny
May 22, 2017 at 5:52 am #797381Hi,
You can try to search with these keywords get ftp access hostname where you replace hostname with the host where your site resides. For example godaddy has this instruction: https://ph.godaddy.com/help/find-your-ftp-loginusername-4881
I have modified the code you have on functions.php and the problems are the single and double quotes which are reflecting on the frontend. Can you check again and tell us if it works :)
Best regards,
NikkoJune 26, 2017 at 1:23 am #812853Hi Nikko,
I’m after something similar; we’ve been adding multiple ids to track different events, however we’re not sure how to add pixel code to the Woocommerce ‘thank you’ page specifically.
Any help would be much appreciated.
Thanks,
TankerJune 26, 2017 at 9:23 am #812924Hi,
You can try this code: https://pastebin.com/i3Y9MEBv
There are more options you can use, for more information just go to: https://codex.wordpress.org/Conditional_Tags and find is_page(). Hope this helps :)Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.