Expand my Community achievements bar.

SOLVED

React SPA & Form-Based Experience Composer

Avatar

Level 2

Hi all,

 

How can I target a specific view in React SPA with the form base composer? It only works on the first page load but not if I navigate to a new page/view.

 

I know it is possible with VEC, but I can't use it.

 

Many thanks,

UK

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @UKCH,

You can use adobe.target.triggerView() accordingly when navigating to a new page. It is important that at.js 2.x is used.


https://experienceleague.adobe.com/docs/target-learn/tutorials/experiences/use-the-visual-experience...

 

Hope this helps you
Best regards

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @UKCH,

You can use adobe.target.triggerView() accordingly when navigating to a new page. It is important that at.js 2.x is used.


https://experienceleague.adobe.com/docs/target-learn/tutorials/experiences/use-the-visual-experience...

 

Hope this helps you
Best regards

Avatar

Level 2

Hi @Perrin_Ennen, thank you, but as I wrote in the question, I can't create an VEC A/B test, is it possible to use triggerView() with form-based A/B tests?

Avatar

Community Advisor

Hi @UKCH,

 

Hi,
I am not quite sure myself - as far as I know triggerView() is rather meant for VEC and serverside targeting.

 

I remember a SPA where I worked with form-based experiments. I don't know if that was a good solution. But in that case I triggered even the target-global-mbox (by adobe.target.getOffer() ..) on a SPA page change. The activity was built in such a way, that it itself determines in which view the page is located. Works technically - but yes - you have to be careful that e.g. no other activities are running on the pages - or that is considered accordingly there.