Announcement

Collapse
No announcement yet.

Where to place the Bing Ads UET code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Where to place the Bing Ads UET code

    Hello All,

    So we have never been able to get the Bing Ads UET conversion tracking to work though our tag does show as "active" under Bing Ads. So I have been working with Bing support. They had me change the "goal type" from URL based to event based, because Miva just has the single invoice page and not a thank you/confirmation type page at the end of the checkout process. Not sure about all that but anyway.

    So the code ... (our tag ID replaced with xxxxxxx)

    <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"xxxxxxx"};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(){v ar s=this.readyState;s&&s!=="loaded"&&s!=="complete"| |(f(),n.onload=n.onreadystatechange=null)},i=d.get ElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document, "script","//bat.bing.com/bat.js","uetq");</script>

    <script>

    window.uetq = window.uetq || [];

    window.uetq.push

    ({ 'ec':'customer', 'ea':'buys', 'el':'something', 'ev':'1', 'gv':&mvt:order:total; });

    </script>

    <noscript><img src="//bat.bing.com/action/0?ti=xxxxxxx&Ver=2" height="0" width="0" style="display:none; visibility: hidden;" /></noscript>


    They've had me move this from before the closing body tag on the INVC page and into the head tag. With no result. So the next thing they want me to try is to associate the "push" script with the "place order" submit button on the OPAY page.

    So looking at the OPAY page template I don't see that the submit button code is there. So then I guess that is actually an "item" I need to edit right?

    I appreciate any advice from anyone that's tackled this.

    Thank you,
    Last edited by Southlander; 03-08-16, 01:28 PM.
    Sean Harrell
    Southland Trade Corp.

    #2
    This tracking snippet has been very problematic in our experience. We had a client go round and round with Bing however we were finally able to get it to fire properly. The initial portion of the script should be global, with the conversion event being on the invoice screen only. This can be implemented in the global footer with a screen check for INVC to trigger the conversion event. I also seem to recall an issue with passing ec, el and/or ev values at one point, though I would have to look through our notes.

    Comment


      #3
      Cool thanks. That helps.
      Sean Harrell
      Southland Trade Corp.

      Comment


        #4
        Got this working. Thank you Dan @ Glendale for getting me on the right track. The Bing documentation is not very clear in terms of being directly relate-able to Miva Merchant. So here are the steps for anyone that stumbles onto this.

        1. Set up your UET tag and your conversion Goal at Bing Ads, and be sure the GOAL TYPE is set to EVENT. That's pretty straightforward by just clicking through it.

        2. Your custom event field settings are arbitrary, because it is not really this data you need but rather the custom variable for the Miva Order total, which is elsewhere in the code (below). Our custom event settings are just: Category = Customer, Action = Buys, Label = Something, and Value = 1 (pictured below). None of what you use there matters. Make something up.

        3. Go into your UET Tags, and choose View Tag. Copy all that code, which amounts to a single JavaScript and then also a non JavaScript snippet. Get it ALL and place that in your Global Head Tag, under the Global Header page in Merchant admin. Again it goes in the HEAD TAG not the Global Header.

        4. Then you'll lastly need this most important piece of code:

        <script>

        window.uetq = window.uetq || [];

        window.uetq.push

        ({ 'ec':'customer', 'ea':'buys', 'el':'something', 'ev':'1', 'gv':&mvt:order:total; });

        </script>

        This piece of code goes on your INVC page in the template just above the closing "</body>" tag. Note the variable values match the event goal settings I mentioned above. But I have also added the extra variable for the Miva order total at the end. The 'gv':&mvt:order:total; part.

        5. Now lastly go back to your Global Head TAG and add that "gv" variable to the non-JavaScript piece of code so that it looks like this:
        <noscript><img src="//bat.bing.com/action/0?ti=xxxxxxx&Ver=2&gv=&mvt:order:total;" height="0" width="0" style="display:none; visibility: hidden;" /></noscript>

        That's it. On Bing Ads it could take up to 3 hours for any actual conversions to show up.
        Last edited by Southlander; 03-10-16, 04:40 PM.
        Sean Harrell
        Southland Trade Corp.

        Comment


          #5
          For what it's worth - I've tried using this in two different sites and both sites are not reporting correctly at all. One site was able to reach directly out to Bing Ads Support and was told the configuration was incorrect. Bing Ads Support told the store owner to place all 3 snippets in the HEAD Tag including the revenue code


          Code:
          <!-- BING code -->
          <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"xxxxxxx"};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=xxxxxxx&Ver=2&gv=&mvt:order:total;" height="0" width="0" style="display:none; visibility: hidden;" /></noscript>
          <!-- EOF BING code -->
          <!-- Bing Special Event Tracking Code  -->
          <script>
          window.uetq = window.uetq || [];
          window.uetq.push
          
          ({ 'ec':'customer', 'ea':'buys', 'el':'something', 'ev':'1', 'gv':&mvt:order:total; });
          </script>
          <!-- Bing Revenue Code -->
          <script>
          window.uetq = window.uetq || [];
          window.uetq.push({ 'gv': &mvt:order:total;(), ‘gc’: USD});
          </script>
          Since I had another store owner's conversion specialist send this post back to me I thought should mention that the results may vary. I will follow up as soon as I find out if what Bing Ads Support recommended works or not.


          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment


            #6
            Is the Scope on the Conversion Goal set to "Across all accounts" or a specific account?

            Comment


              #7
              Originally posted by Dan - Glendale Designs View Post
              Is the Scope on the Conversion Goal set to "Across all accounts" or a specific account?
              That is a good question - I will ask the account manager(s). I know I shouldn't assume that it is correct just because Bing Ads Support is involved. What setting have you found to work best?
              Leslie Kirk
              Miva Certified Developer
              Miva Merchant Specialist since 1997
              Previously of Webs Your Way
              (aka Leslie Nord leslienord)

              Email me: [email protected]
              www.lesliekirk.com

              Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

              Comment


                #8
                We found that setting it to a specific account will prevent conversion tracking and reported it as a bug to Bing Ads Support. This was after weeks of banging our heads with reps telling us the code was wrong, even though we had fully validated it, that it needed to be in the head tag and that other tracking snippets were interfering. If this is the case, setup a new Goal, set it to "Across all accounts" and it should kick in.

                Comment


                  #9
                  Originally posted by Dan - Glendale Designs View Post
                  We found that setting it to a specific account will prevent conversion tracking and reported it as a bug to Bing Ads Support. This was after weeks of banging our heads with reps telling us the code was wrong, even though we had fully validated it, that it needed to be in the head tag and that other tracking snippets were interfering. If this is the case, setup a new Goal, set it to "Across all accounts" and it should kick in.
                  Dan, I have tried everything. SInce you have been successful, I have advised the store owner to reach out to you (Glendale Designs).
                  Leslie Kirk
                  Miva Certified Developer
                  Miva Merchant Specialist since 1997
                  Previously of Webs Your Way
                  (aka Leslie Nord leslienord)

                  Email me: [email protected]
                  www.lesliekirk.com

                  Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                  Comment


                    #10
                    Dan, I have tried everything. SInce you have been successful, I have advised the store owner to reach out to you (Glendale Designs).
                    Sounds good Leslie, we will definitely give it our best shot based on what we have come across with the platform.

                    Comment


                      #11
                      This thread is old, does anyone have an update on the best was to handle Bing conversions?

                      Comment

                      Working...
                      X