at.js 2.x on SPA handling back button | Adobe Higher Education
Skip to main content
sambhavj5011451
Level 2
August 7, 2019
Respondido

at.js 2.x on SPA handling back button

  • August 7, 2019
  • 3 respostas
  • 3672 Visualizações

Hi,

I had some experience Targeting Activity running on a react app. I have placed code on URL path change to trigger triggerView() function which is working fine.

I did some personalizations like changing text etc. All of them works fine when I navigate to the views via website clicks.

But when I click on browser back button, it shows the default content of view and not the content coming from Target activity.

Has anyone got similar issue and the way to resolve it.

Thanks

Sambhav

Este tópico foi fechado para respostas.
Melhor resposta por sambhavj5011451

Hi Amelia,

If we use Launch/DTM to triggerview on URL/hash change detect, then back button will override the original content.

The solution to this is to move the triggerview function in router (in your react app) so that irrespective of from where the view is changed, triggerview will always be triggerred.

Thanks

Sambhav

3 Respostas

September 2, 2019

Hi Sambhav,

I had the same issue but have resolved it now. For me, it was because the changes were made on the 'Page load event' in Target rather than on the actual view. This meant that the change only appeared on the initial page load.

Once I added the change to the view picked up by Target, I could see the experience appearing after clicking on the back button.

Cheers,

Karen

Amelia_Waliany
Adobe Employee
Adobe Employee
October 21, 2019

Hi Sambhav! Reaching out to see if you were able to resolve the issue? Thanks for posting and we look forward to hearing from you!

sambhavj5011451
sambhavj5011451AutorResposta
Level 2
October 21, 2019

Hi Amelia,

If we use Launch/DTM to triggerview on URL/hash change detect, then back button will override the original content.

The solution to this is to move the triggerview function in router (in your react app) so that irrespective of from where the view is changed, triggerview will always be triggerred.

Thanks

Sambhav