Tagged: x
-
AuthorPosts
-
December 4, 2016 at 7:57 pm #1281000
Kelly RParticipantHi,
I need to add a Facebook pixel to one of the tag archive pages on our blog (not sitewide). How can I place the pixel on the specific tag archive page?
Thanks!
December 4, 2016 at 9:35 pm #1281083
LelyModeratorHello Kelly,
Thanks for posting in.
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then add the following on your child theme’s functions.php file.
add_action('wp_head','my_tracking_pixel'); function my_tracking_pixel() { if ( is_archive() ) { ?> <!-- Add Your Tracking Pixel Here --> <?php } }See this:https://codex.wordpress.org/Function_Reference/is_archive. If it’s specific to tag archive, please update is_archive() with is_tag(). See this:https://codex.wordpress.org/Function_Reference/is_tag
Hope this helps.
December 4, 2016 at 10:21 pm #1281114
Kelly RParticipantThis reply has been marked as private.December 4, 2016 at 11:19 pm #1281161
LelyModeratorHello Kelly,
That is supposed to be correct. But then I cannot confirm it because you didn’t share the exact pixel code you have added. On the frontend, we can only check if we saw the code when we view the source. I can’t see any facebook pixel code. If you have caching, try to purge cache. I am seeing Google tag manager code but not FB pixel code.
December 5, 2016 at 7:19 am #1281521
Kelly RParticipantThis reply has been marked as private.December 5, 2016 at 8:06 am #1281581
Paul RModeratorHi Kelly,
I checked your code and it seems correct.
I double checked the page source code and I can see the code getting added.
http://screencast.com/t/dRYYO60lwGg
If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1281000 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
