-
AuthorPosts
-
July 10, 2015 at 5:32 pm #326974
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>
July 10, 2015 at 11:05 pm #327095Hi 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.
July 11, 2015 at 7:40 am #327306Perfect – thanks!
July 11, 2015 at 7:51 am #327307You’re welcome.
July 11, 2015 at 4:25 pm #327426Hey 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 againJuly 11, 2015 at 8:51 pm #327494Similarly, 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>July 11, 2015 at 9:01 pm #327498One 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 againJuly 12, 2015 at 12:06 am #327568Hello 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 / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
July 12, 2015 at 7:17 am #327745This reply has been marked as private.July 12, 2015 at 8:09 am #327775Hi 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.
July 12, 2015 at 12:17 pm #327874Okay – thank you!
July 12, 2015 at 4:55 pm #328017You’re weclome!
-
AuthorPosts