Bing UET Tag in Iframes

UET Tag hacking

After expanding my advertising efforts with my company OMP Tools from Google AdWords to Bing Ads, I ran into a few difficulties while implementing a functioning Conversion Tracking with the UET Tag.

The difference between UET Tag and AdWords Conversiontracking

The two tracking methods are fundamentally different, as for example FRWD wrote in his excellent article about bing ads UET.

Basically, the UET Tag is more like the Google Analytics tag, so it should be implemented on every single page to allow Microsoft to collect all the datas. In a second step, you have to define the Goals in Bing Ads.

This version of the tracking offers various advantages:

  • measuring site-wide statistics as conversions (duration of visit, …)
  • easy implementation (one single script)
  • Javascript events

But, like always, with increased settings comes increased risk of errors. Just the definition of every single target Url could have users sweating if they entered the values correctly.

Where I ran into an issue

My Problem, on the other hand, was something a little different. On some landingpages that I use, the tracking of conversions is done via AJAX in an Iframe. So i put the UET Tag into the Iframe, and voila – it fired, no problem.

Just a few hours later I realized that there is more to it, because Microsofts bat.js does not track the direct URL if the window.self differs from the window.top:

This is quite bad for this (I know, not best practise, but hey – it happens all the time) method of tracking, as the targetURL does not get tracked by UET. Therefor I altered the script a little bit to exclude this part and changed it to that:

The minified version of this script can be found at https://bing.fischi.cc/bat.js

Disclaimer

If you have trouble tracking conversions in an Iframe when unsing Bing UET Tag, you can think about embeding my script instead. It is the same, but without the three lines removed.

Please be sure to validate if this works for you. If so, change your UET Tag from

to this:

It works perfectly for me – the submitted „p“ parameter now shows the URL of the Iframe.

Ein Kommentar

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert