6 Replies Latest reply on Jun 19, 2018 10:21 AM by Michael Guanci

    Re-direct page no longer redirecting to pdf asset

    Michael Guanci

      Hi Everyone,

       

      A few months ago I started running into the issue around the email sercuity bot scanners counting false clicks in marketo.  One way to combat this was following Sanford Whiteman blog post around using the redirect page as a way to find the true clicks with a web visit along with the email click.

       

      The problem I have ran into recently is the re-direct page is no longer re-directing to the asset.  Instead, I get a blank page and no longer get the 4 dots at the top and then the pdf appears.  I noticed this issue has been happening for the past two weeks and was wondering if any other people have run into this issue as well.

       

      I always start the URL the same with http://pages.abc.com/Asset-Redirect#{asset url}

       

      I can attach the code I have on the page as well if that might help indicate what might be the issue. 

        • Re: Re-direct page no longer redirecting to pdf asset
          Dan Stevens

          The purpose of this technique is not to combat false positives from link scanners, but to provide a more positive experience for the end-user.  Normally, you want to direct all email clicks to your website to convert (e.g, download the PDF file) so that they can also be cookied with the Munchkin tracking code.  If you just provided a PDF link in your email, the user wouldn't be cookied.  Sanford's technique not only minimizes the clicks it takes to download the PDF file, but also cookies the user - without having to visit a landing page.

           

          And yes, both the link that you're using, along with the code will help Sanford diagnose this issue for you.

          • Re: Re-direct page no longer redirecting to pdf asset
            Michael Guanci

            Here is the code on the redirect page template

             

             

            <!DOCTYPE html>

            <html>

              <head>

            <script type="text/javascript">

              document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin-beta.js' type='text/javascript'%3E%3C/script%3E"));

            </script>

            <script>

              Munchkin.init('744-KEV-407'); // your Munchkin ID and options, obviously!

            </script>

            <script>

              (function(redirectTarget){

                var allowedOrigins = [

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

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

                     'https://brainshark.com',

                     'https://www.brainshark.com/resources/'

                     'http://offers.brainshark.com/',

                    ], // which domains are allowed for redirection

                    redirectMs = 3500, // how long before redirecting 

                    progressMs = 500,  // how long between updates of the "progress meter"

                    progressChar = '&bull;', // progress character (HTML bullet)

                    errNoAsset = 'Asset URL not found.', // message when no asset in hash

                    errInvalidAsset = 'Asset URL not allowed.', // when asset not our domain

                    progress = setInterval(function(){

                      if (redirectTarget) {

                        document.body.insertAdjacentHTML('beforeend',progressChar);

                      } else {

                        clearInterval(progress), clearTimeout(redirect);         

                        document.body.insertAdjacentHTML('beforeend',errNoAsset);         

                      }

                    }, progressMs),

                    redirect = setTimeout(function(){        

                        var redirectLoc = document.createElement('a');

                        redirectLoc.href = redirectTarget;

                        redirectLoc.origin = redirectLoc.origin ||

                            [redirectLoc.protocol,

                              '//',

                              redirectLoc.hostname,

                              ['http:','http:80','https:','https:443']

                                .indexOf(redirectLoc.protocol+redirectLoc.port) != -1

                                  ? ''

                                  : ':' + redirectLoc.port

                            ].join('');

             

             

                        clearInterval(progress);

                        if (allowedOrigins.indexOf(redirectLoc.origin) != -1) {           

                          document.location.href = redirectTarget;

                        } else {

                          document.body.insertAdjacentHTML('beforeend',errInvalidAsset);                  

                        }

                    }, redirectMs);

                })(document.location.hash.substring(1));

            </script>

                <meta charset="utf-8">

                <meta class="mktoString" mktoName="Variable 1" id="var1" default="This is a variable">

                <title></title>

                <style>

                  body {background:#fff;}

                </style>

              </head>

              <body>

              </body>

            </html>

              • Re: Re-direct page no longer redirecting to pdf asset
                Sanford Whiteman

                You have a typo in the JS. Looks like you added another allowed domain at some point but left out a comma.

                 

                allowedOrigins = [
                         'http://pages.brainshark.com',
                         'http://www.brainshark.com',
                         'https://brainshark.com',
                         'https://www.brainshark.com/resources/'
                         'http://offers.brainshark.com/',
                        ],
                

                 

                should be

                 

                allowedOrigins = [
                         'http://pages.brainshark.com',
                         'http://www.brainshark.com',
                         'https://brainshark.com',
                         'https://www.brainshark.com/resources/',
                         'http://offers.brainshark.com/'
                        ],
                

                 

                (If you look in your browser's F12 console you'll see the resulting error "SyntaxError: Unexpected string".)