getOffers method not returning offers when Audience is added to Activity | Community
Skip to main content
Level 2
May 10, 2024
Solved

getOffers method not returning offers when Audience is added to Activity

  • May 10, 2024
  • 1 reply
  • 1557 views

We created an experience fragment in AEM and exported it to target in JSON format and created an activity in Target using the JSON xf. We use getOffers method as per adobe document in AEM using react in SPA to get the JSON data on webpage. https://experienceleague.adobe.com/en/docs/target-dev/developer/server-side/node-js/get-offers#:~:text=Example-,Node.js,-const%20TargetClient%20%3D 

Without adding Audience to experience we are getting JSON on webpage. But when we add Audience to Experience, we are getting response but JSON xf(offer) is missing in JSON. Do we have to pass anymore parameters? We use the same code mentioned in document.

 

@alexbishop @gokul_agiwal @ryanr7 @pratheeparunraj @ambikatewari_atci 

 

 

 

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 alexbishop

Ok, one thing to be aware of is that same/next page personalisation isn't supported when you're not interacting with Target via the Web SDK/Edge Network. So even if the implementation is correct, it would be supporting next-session use cases due to audience qualification latency (more info here).

If you do want to utilise Edge segmentation & same/next page use cases, then this help doc talks through the different options available

1 reply

alexbishop
Adobe Employee
Adobe Employee
May 10, 2024

Based on your description, you're not qualifying for the Audience you have applied. It might be that you need to pass some additional parameters but that depends on your audience. What is the Audience definition? 

If you do need to pass some additional parameters then you can refer to the Delivery API docs (the Node SDK makes use of the Delivery API) to see how to structure everything

Level 2
May 10, 2024

Hi @alexbishop 

True, the logged in user is not qualifying for audience. Audience is created in AT with segment in AEP. We are sure that the user we used to login is present in audience in AT. We doubt that issue is we fail to pass userdetails in request. Below is the code we used to get offer.

 

const TargetClient = require("@adobe/target-nodejs-sdk");
const CONFIG = {
  client: "acmeclient",
  organizationId: "1234567890@AdobeOrg"
};

const targetClient = TargetClient.create(CONFIG);

const request = {
    context: {channel: "web"},
    execute: {
        mboxes: [{
            name: "a1-serverside-ab",
            index: 1
        }]
}};

const response = await targetClient.getOffers({ request });

Currently we are not passing any user information in API call. From this document we got that it should be passed as id in request. https://experienceleague.adobe.com/en/docs/target-dev/developer/api/delivery-api/identifying-visitors#:~:text=1200%2C%0A%20%20%20%20%20%20%20%20%20%20%22height%22%3A%201400%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%2C-,%22id%22%3A%20%7B,-%22marketingCloudVisitorId%22%20%3A%20%222304820394812039%22%2C%0A%20%20%20%20%20%20%20%20%22customerIds 

But we are not clear on how to get marketingCloudVisitorId and integrationCode.

 

 

 

alexbishop
Adobe Employee
alexbishopAdobe EmployeeAccepted solution
Adobe Employee
May 10, 2024

Ok, one thing to be aware of is that same/next page personalisation isn't supported when you're not interacting with Target via the Web SDK/Edge Network. So even if the implementation is correct, it would be supporting next-session use cases due to audience qualification latency (more info here).

If you do want to utilise Edge segmentation & same/next page use cases, then this help doc talks through the different options available