How and where do I add the Bing tracking code
-
I am trying to add a bing tracking code to my in the order conformation page. Where would I put it? I read that I needed to put it in the function.php page. I tried that and it crashed the site. This is the code I put in there.
`add_action( ‘woocommerce_thankyou’, ‘my_custom_tracking’ );
function my_custom_tracking( $order_id ) {
Lets grab the order
$order = new WC_Order( $order_id );
<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:”5039864″};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><img src=”//bat.bing.com/action/0?ti=5039864&Ver=2″ height=”0″ width=”0″ style=”display:none; visibility: hidden;” /></noscript>
}
`
I placed it at the end of my function file. Am I missing something?
Thanks
Jeff
- The topic ‘How and where do I add the Bing tracking code’ is closed to new replies.