Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30115
    info
    Guest

    I’ve added a facebook pixel to my pages between the header tags using the Head, Footer and Post Injections plugin.

    I now want to add a facebook event script eg:-
    <script>
    fbq(‘track’, ‘Lead’);
    </script>

    which should be added after the <body> tag

    If I switch the text editor & paste the code in, 

    script code added to text editor

    when I switch back to visual editor Boldgrid has added a block to my page & moved my heading down

    Visual editor screenshot

    Switching back to the text editor you can see the unwanted extra code

    extra code added

    How do I add this script without Boldgrid putting it in a block?

    #30116
    christopherm
    Guest

    Does this code need to be individual pages or on each page? If the latter, it would be best to add it to a template file using either a plugin or in a child theme.

    #30117
    info
    Guest

    The code only goes on certain pages – not every page

    #30118
    christopherm
    Guest

    Adding JavaScript directly to a WordPress page or post is forbidden, even in text mode. So this would happen in any site, not just in BoldGrid. I’d advise checking to see if Facebook has a plugin to support the addition of this script on pages you select. Or, using a plugin like Advanced Custom Fields, you can add advanced metadata to posts and pages.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to facebook event script’ is closed to new replies.