How to implement web sdk on spa | Community
Skip to main content
vijayc88216288
May 31, 2023
Solved

How to implement web sdk on spa

  • May 31, 2023
  • 2 replies
  • 3102 views

I have been trying to implement adobe web sdk(only target) in the SPA environment. On the view change i am firing alloy.event to render the experience through target.

In the current state, i can see my calls are going to target but getting no personalisation from target.

 

could anyone help me here.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by PratheepArunRaj

On hard refresh, I am getting a personalized experience.
I am not sure, what difference are you referring to in the payload call.


@vijayc88216288 ,

This means, on the Page Load you are getting the personalized experience, but on the screen change (View change/history change), you are unable to see the experience.

Did you check the example given under "An equivalent Platform Web SDK sendEvent approach" in the link. Kindly give it a try.

Thank You, Pratheep Arun Raj B (Arun) | NextRow Digital | Terryn Winter Analytics

 

2 replies

_Manoj_Kumar_
Community Advisor
Community Advisor
June 1, 2023

Hello @vijayc88216288 

 

Can you share more details on the payload of the API calls and how you are firing the events on view change?

     Manoj     Find me on LinkedIn
vijayc88216288
June 1, 2023

Currently I am sending the below code to fire on every view.

 if(window.alloy){
    window.alloy("sendEvent", {
      "renderDecisions": true,
      "xdm": {
        "web": {
          "webPageDetails": {
            "viewName": "category"
          }
        }
      }
    });
  }
And I can see the network call as well

If I hard refresh the page then the experience load however if a view gets changed then no personalization.

Let me know if I miss anything here.

 
PratheepArunRaj
Community Advisor and Adobe Champion
PratheepArunRajCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 1, 2023

On hard refresh, I am getting a personalized experience.
I am not sure, what difference are you referring to in the payload call.


@vijayc88216288 ,

This means, on the Page Load you are getting the personalized experience, but on the screen change (View change/history change), you are unable to see the experience.

Did you check the example given under "An equivalent Platform Web SDK sendEvent approach" in the link. Kindly give it a try.

Thank You, Pratheep Arun Raj B (Arun) | NextRow Digital | Terryn Winter Analytics

 

PratheepArunRaj
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 1, 2023

Dear @vijayc88216288 ,

Did you receive the Personalization Response from Edge? If not, make sure that your data stream is configured for Target and 'renderDecisions' is set to 'true' in the SendEvent call.

If you receive the Personalization Response from Edge, however, if offers are not applied, then you need to validate the segment qualification. Try the 'all visitor segment' and see whether the offers are applied to the page.

If possible, share the public URL so that we can validate it for you.

Also, go through the Web SDK Migration for Adobe Target once again to see the missing pieces if any.

Thank You, Pratheep Arun Raj B (Arun) | NextRow DigitalTerryn Winter Analytics

 

NimashaJain
Adobe Employee
Adobe Employee
June 1, 2023

Hey @pratheeparunraj ,

 

Seeing you after a long in AEP Community! 🙂 

PratheepArunRaj
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 1, 2023

Yeah @nimashajain ,

Was busy with Adobe Summit Presentations and then with my paternity. Getting time and thus back in Community.

Thank You, Pratheep Arun Raj B (Arun) | NextRow DigitalTerryn Winter Analytics