Re: Track File Links?

SanfordWhiteman
Level 10 - Community Moderator

Re: Track File Links?

Hmm, maybe -- better get the latest from the demo: http://codepen.io/figureone/pen/GWZmGo/?editors=0010

Dan_Stevens_
Level 10 - Champion Alumni

Re: Track File Links?

Works fine in all browsers now - even Edge!  Thanks Sandy.

Anonymous
Not applicable

Re: Track File Links?

There's another bug we discovered as we were using older versions of IE that does not process "IndexOf" properly, to fix this I added this if statement before the function and this fixed the issue.

<script>

if (!Array.prototype.indexOf) {

    Array.prototype.indexOf = function(obj, start) {

         for (var i = (start || 0), j = this.length; i < j; i++) {

             if (this[i] === obj) { return i; }

         }

         return -1;

    }

(function(redirectTarget){ 

    var allowedOrigins = [ 

         'http://pages.example.com', 

         'http://www.example.com', 

         'http://example.com'  .......

SanfordWhiteman
Level 10 - Community Moderator

Re: Track File Links?

Oh you were testing in IE 8?  I don't build for IE 8 compat in a Marketo environment as core Mkto features don't work in IE 8, anyway.

Array#indexOf is in IE 9 and later.

Anonymous
Not applicable

Re: Track File Links?

Yes, unfortunatly our IT dept are slow to update browsers, the same applies to alomst all big companies out there, I know our clients still use older browsers. So for those out there still using older browsers, adding that fix for IndexOf will make this solution work for them. Either case thank you for your overall solution! and for anyone who is not following your blog.. IT IS A MUST READ for anyone in the Marketo world!

SanfordWhiteman
Level 10 - Community Moderator

Re: Track File Links?

Yeah, I know IE8 is out there (though in finserv IT should be looking at it from from a security perspective, difficult or not!).

Just make sure you guys don't expect other Mkto things to work in IE8, like secure LPs and forms (the former being a valuable tracking tool, not just a security measure). And all my code is written for IE9+.

Julia_Rosentha3
Level 2

Re: Track File Links?

Genius solution Sanford Whiteman​, love your work... AGAIN!

Thank you