Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #326974

    stylinsmitty
    Participant

    Hi,

    For some reason I can’t get 2 javascript tracking snippets to work on my site at the same time. Please see: http://screencast.com/t/rp8w6b6vw

    I removed the Bing script so that my GA keeps working. Below is the Bing script I’d like to add. Maybe I need to remove the <script> tags? Maybe the <noscript> tags?

    Any ideas?
    Thanks

    /* Bing Conversion Tracking */
    <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:”4061506″};o.q=w[u],w[u]=new UET(o),w[u].push(“pageLoad”)},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!==”loaded”&&s!==”complete”||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,”script”,”//bat.bing.com/bat.js”,”uetq”);</script><noscript></noscript>

    #327095

    Darshana
    Moderator

    Hi there,

    Thanks for writing 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 code into your functions.php file.

    
    add_action( 'wp_footer', 'custom_page_script', 10 );
    
    function custom_page_script(){
        echo '
    /* Bing Conversion Tracking */
    <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"4061506"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script><noscript></noscript>
        ';
    }
    

    Hope that helps.

    #327306

    stylinsmitty
    Participant

    Perfect – thanks!

    #327307

    Christopher
    Moderator

    You’re welcome.

    #327426

    stylinsmitty
    Participant

    Hey again,

    One quick question:

    After adding that tracking code I noticed that this text shows up in the bottom-left corner of every page: http://screencast.com/t/SIEaaYUW (see makeyourbodywork.com to check it out for yourself).

    I tried changing this part of the code to <!– Bing Conversion Tracking –!> but this broke several elements on my site (e.g. drop-down menus, blog images, etc.)

    Is there something else I can do to remove this text?
    Thanks again

    #327494

    stylinsmitty
    Participant

    Similarly, I am trying to add Google Remarketing as a tag to my whole site. The code is pasted below – When I tried adding this to funtions.php as you described earlier, my whole site disappears (i.e. I just get a blank white screen when loading my home page)

    Removing the Google tag fixes the site. How else can I add this?

    <!– Google Code for Remarketing Tag –>
    <!————————————————–
    Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
    —————————————————>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 1012828055;
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    </script>
    <script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.js”>
    </script>
    <noscript>
    <div style=”display:inline;”>

    </div>
    </noscript>

    #327498

    stylinsmitty
    Participant

    One last update re: Google remarketing tag

    I also tried manually adding it to the most important pages on my site using a Custom HTML element in TCB.

    This works, but it then shows a box outline where that element is placed (i.e. on the front-end of the site a visitor can see an empty box where the code is placed).

    I’m open to any suggestion that will allow me to put this tag on any/all of my pages.
    Thanks again

    #327568

    Rue Nel
    Moderator

    Hello There,

    Please see to it that you added Bing code properly. You can use html comments around the Bing info text instead;
    <!-- Bing Conversion Tracking -->

    For your Google Tag code, you can add this in your footer.php file in the child theme. If nothing else works, would you please provide us the url and access information of your site so we can take a closer look. We would like to check your X installation. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #327745

    stylinsmitty
    Participant
    This reply has been marked as private.
    #327775

    Christopher
    Moderator

    Hi there,

    Update your code in functions.php file to :

    function custom_page_script(){
        echo '
    <!-- Bing Conversion Tracking --!>
    <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"4061506"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script><noscript></noscript>
        
    
    <!– Google Code for Remarketing Tag –>
    <!————————————————–
    Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
    —————————————————>
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 1012828055;
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    </script>
    <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    
    </div>
    </noscript>
    '
        ;
    }

    Hope it helps.

    #327874

    stylinsmitty
    Participant

    Okay – thank you!

    #328017

    Rad
    Moderator

    You’re weclome!