Tradedoubler Ads over HTTPS: Avoiding the "show unsecure objects" in IE ("Denna sida innehåller både säkra och osäkra objekt. Vill du visa osäkra objekt?"

| | Comments (0)
Tradedoubler is one of Swedens largest ad networks. However, all ads are served over a none secure connection (https). This is fine for regular users, but if you are building a member only site with secure login (https) you are out of luck:

Serving both secure (https, all your content) and none secure (the ads) brings up a IE message asking the user if they want to "show unsecure objects" on the site. Every time the users loads a page. (In swedish: "Denna sida innehåller både säkra och osäkra objekt. Vill du visa osäkra objekt?")

So how do we solve this problem?

Usual Tradedoubler Ad code is something like this:

<script type="text/javascript">
var uri = 'http://impse.tradedoubler.com/imp?type(js)g(<id>)a(<id>)' + new String (Math.random()).substring (2, 11);
document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
</script>

As you can see, the url is http://impse. None secure. But a little known fact is that tradedoubler ads can also be served over https://tracker.tradedoubler.com. As far as I know there is no difference.

So we do what many organisations do (such as google analytics). We let javascript check if the maste page was served over http and https. Such as this:

<script type="text/javascript">
var tdHost = (  ("https:" == document.location.protocol)   ?   "https://tracker."  :   "http://imp."  );
var uri = tdHost + 'tradedoubler.com/imp?type(js)pool(<id>)a(<id> + new String (Math.random()).substring (2, 11);
document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
</script>

Simple as that. If it's https it will use https://tracker.tradedoubler.com, if it's http it will use the regular http://imp.tradedoubler.com

The script is hardly perfect, but it works for most purposes. Tradedoubler has been notified of the problem, and hopefully they will implement a solution.

Good luck with your ad serving...

Categories

,

Leave a comment

About this Entry

This page contains a single entry by Niklas Bivald published on August 17, 2008 1:52 PM.

ALA Article: Putting our heads together was the previous entry in this blog.

Article: Top 10 Usability Highs Of Mac OS is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en