Bing Ads Tracking Code

Community Forums Forums General Discussion Bing Ads Tracking Code

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  philsg 1 year, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #90868



    I need to add the Bing Ads tracking code to a thank you page but the scripts sections is no good since this code goes right before the end body tag. It’s for the executive theme.

    Bing ads tracking code (formerly ad center) is notoriously annoying since I’ve been through other tracking issues before with other non wordpress sites.

    Any one knows?



    You can hook it in conditionally using a custom function with genesis_hook that executes immediately before the closing body tag

    Another option is to use wp_enqueue_scripts function and also register the script so you can use it again if needed and not cause any conflicts

    With the 5th parameter

    (boolean) (optional) Normally, scripts are placed in <head> of the HTML document. If this parameter is true, the script is placed before the </body> end tag. This requires the theme to have the wp_footer() template tag in the appropriate place.
    Default: false



    Great, thanks Brad. Do you think the code below could work on the wp_footer() hook? The Bing Ads tracking code is supposed to go just before the end body tag of the confirmation page, in this case the Thank You page

    <?php if (is_page( ‘Thank You’ ) ) { ?>
    <p><script type=”text/javascript”> if (!window.mstag) mstag = {loadTag : function(){},time : (new Date()).getTime()};</script> <script id=”mstag_tops” type=”text/javascript” src=”//”></script> <script type=”text/javascript”> mstag.loadTag(“analytics”, {dedup:”1″,domainId:”1438847″,type:”1″,actionid:”48555″})</script> <noscript> <iframe src=”//″ frameborder=”0″ scrolling=”no” width=”1″ height=”1″ style=”visibility:hidden;display:none”> </iframe> </noscript></p>
    <?php } ?>



    Can’t read or copy your code.

    Please paste it from your file into a Github Gist and embed it here. Thanks



    Sorry Brad, here it is <script src=””></script>
    thanks for your help.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.