


Hi all,
I've been trying for several days now to get the at.js 2.0 running for SPAs, until I finally found the documentation. Now that I got it to work using the adobe.target.getOffers() & adobe.target.applyOffers() function I cannot insert the code over Launch because the editor shows an error and the minifying of custom code fails. See screenshots below. Any ideas how this will work out?
Editor:
Build:
Views
Replies
Sign in to like this content
Total Likes
Okay I found the solution in the documentation of .then().
Here is the rewritten code:
adobe.target.getOffers({
request: {
"prefetch": {
"views": [{}]
}
}
})
.then( function(response) { adobe.target.applyOffers({ response: response }); })
.then( function() { console.log("Success"); })
.catch( function(error) { console.log("Error", error)});
Views
Replies
Sign in to like this content
Total Likes
Okay I found the solution in the documentation of .then().
Here is the rewritten code:
adobe.target.getOffers({
request: {
"prefetch": {
"views": [{}]
}
}
})
.then( function(response) { adobe.target.applyOffers({ response: response }); })
.then( function() { console.log("Success"); })
.catch( function(error) { console.log("Error", error)});
Views
Replies
Sign in to like this content
Total Likes