Highlighted

Target URL Redirect too slow/shows both pages

stephenm6392338

24-04-2018

Hi there!

I now have my A/B test with URL redirect set up! 50% of users that land on site.com/a are successfully getting redirected to site.com/b

The issue I'm experiencing is that the intital page (site.com/a) loads fully before the redirect (to site.com/b) happens ... this means the user sees the two pages and also the page loading time is slowed down considerably.

Does anyone have any experience with this or advice on how I might correct?

Ideally the user wouldn't see site.com/a at all when the redirect condition is met....

GIF attached showing redirect behaviour

redirect.gif

Replies

Highlighted

russpainter

24-04-2018

Can you provide more details about how this is setup? Are you using at.js? Are you using a global mbox or regional? Did you use a redirect offer in Target or code your own redirect?

Highlighted

stephenm6392338

24-04-2018

Thanks russpainter ... to answer your q's ...

I have implemented at.js for Angular ngRoute following the instructions available at Angular ngRoute · Adobe-Marketing-Cloud/target-atjs-extensions Wiki · GitHub

As per the instructions I have "Include(d) at.js without the auto-created mbox"

I set up the the redirect using the "Redirect to URL" on Experience B in the VEC for target...

- - -

I'm confident that I followed the implementation instructions, the only thing I don't fully understand is the whole "auto-created mbox" and the effect that has...

Any help very much appreciated.

Highlighted

rajneesh_gautam

25-04-2018

Hi Stephen, after looking at your video I did some quick troubleshooting and found that the code responsible for creating Global-mbox sits in the middle of the body of your Get-quote page (line number 639)

Search for following on Page-source:

<iframe src="/motor-web/lib/test-target/at.html" style="width:1px;height:1px;position:absolute;left:0px;top:0px; background: transparent; border:none;"></iframe>

On the Page:

Car Insurance Quotes from 123.ie | Insurance you can count on

There seems to be a lot of content before this call in <BODY> which would load first before Target initiates the redirect and thats why you see default page first. Solution will be to move your Target code to as up on the page as possible (recommended in in <HEAD>)

Hope this helps,

Regards,

Rajneesh

Highlighted

stephenm6392338

25-04-2018

Thanks rajneesh!

I have attempted to move the target specific files up into the head however this causes errors in the application as it's kicking in before Angular is defined. Angular is, by default, loaded at the bottom of the page. Currently I include the target files directly after angular.

Highlighted

rajneesh_gautam

25-04-2018

Sorry Stephen as I am not well-versed with Angular.js setup requirements so you may either have to ask CC or work with an Angular developer to explore options around how you can make call to Target in <HEAD>.

Regards,

Rajneesh

ninac7431127

Employee

27-04-2018

Hello Stephen,

Target manipulates the current page DOM. This is why we recommend loading at.js in <head> HTML section of the page.

Try to:

  • Load at.js in html <head> section with mbox auto create true
  • Load at.js angular ng-route extension lib after angular.js, angular-route.js

Because angular and at.js extension stuff are loaded at the end of <body> tag you might see flickering.

Thank you,

Nina.

Highlighted

stephenm6392338

27-04-2018

Hi Nina,


Can you explain why you say to "Load at.js in html <head> section with mbox auto create true" ??

The instructions at Angular ngRoute · Adobe-Marketing-Cloud/target-atjs-extensions Wiki · GitHub  specifically say to include at.js with mbox auto create "false"...

I'm confused about this - what is the impact of setting true/false?

Highlighted

ninac7431127

Employee

27-04-2018

Hi Stephen,

Those instructions assume that angular, at.js and at.js extension libs are loaded in HTML head section.

Especially if you have a redirect offer: imagine that you have to render the whole page till at.js will be loaded then it will fire a request to load offers (redirect) and then fire a redirect.

For your specific case, when you load angular.js and at.js extension at the bottom of the page you'll need to load at.js with mbox auto create true. That will load offers, in case of a redirect offer, it will fire a redirect without loading the whole page. For other types of offers, you'll need to fire global mbox at every route change and at.js extension will do this job. Unfortunately, you'll end up with two mbox calls at load page.

Mbox auto-create true - will pre-hide the body tag ( with opacity:0 CSS style ), retrieve Target offers and modify page DOM accordingly.

Mbox auto-create false - means that no Target requests will be fired.

Angular ngRoute extension will take care of retrieving Target offers and modify page DOM.

Highlighted

stephenm6392338

30-04-2018

Hi Nina thanks again for getting back to me.


I'm still struggling with this. I have set the globalMboxAutoCreate to true as per your instruction but it doesn't pre-hide the page, it still performs the same.

The only way I have been able to hide the page is to include the "pre-hiding code snippet" available at https://marketing.adobe.com/resources/help/en_US/target/ov2/c_target-atjs-faq.html ​... when I had globalMboxAutoCreate set to false the "pre-hiding code snippet" didn't even work!!

I've been on to support a few times about this issue and I'm lost as to what the correct set up should be ?!