adobe / adobe/target-nodejs-sdk-samples

Not prefetching views

Open
#25 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
19
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Hi,

We’re using the `next-server-side-rendering-demo` for a pretty large project and this is the first server-side integration within the company. If we use the `targetClient.getOffers()` call as it is in the demo, the request is not prefetching any views - this is the response we receive:

```js
AT: Response received {
"status": 200,
"requestId": "xxx",
"id": {
"tntId": "xxx"
},
"client": "xxx",
"edgeHost": "mboxedge35.tt.omtrdc.net",
"prefetch": {} // empty
}
```

If we replace the `prefetchViewsRequest` variable with an older mbox call

```js


execute: {
mboxes: [
 {
address: {
url: requestURL,
},
name: mboxName,
},
],
}
```

the request does return the experiments for that mbox. We've checked the config numerous times and are calling the right properties, etc. We do have A/B tests configured based on URL location, but I suspect this might have to do with how we configure our A/B tests in the AT dashboard, is there anything specific that we need to do to get the experiments to show up when we prefetch views?

Then, what would the best approach be for handling action execution once the views have been fetched? Ideally, we would like to avoid having to hardcode anything into our codebase and handle everything within the dashboard. So if, for example, we wanted to change a button color, we don’t want to have to update the code to handle a flag of sorts, we want that action to fire automatically - is that possible?

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.