Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Cannot deploy at.js code 2.0 over Adobe Launch

Avatar

Avatar
Contributor
Level 3
KRAZ
Level 3

Likes

22 likes

Total Posts

35 posts

Correct Reply

2 solutions
Top badges earned
Contributor
Validate 10
Validate 1
Shape 1
Give Back
View profile

Avatar
Contributor
Level 3
KRAZ
Level 3

Likes

22 likes

Total Posts

35 posts

Correct Reply

2 solutions
Top badges earned
Contributor
Validate 10
Validate 1
Shape 1
Give Back
View profile
KRAZ
Level 3

07-03-2019

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:

1707109_pastedImage_3.png

Build:

1707110_pastedImage_5.png

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
Level 3
KRAZ
Level 3

Likes

22 likes

Total Posts

35 posts

Correct Reply

2 solutions
Top badges earned
Contributor
Validate 10
Validate 1
Shape 1
Give Back
View profile

Avatar
Contributor
Level 3
KRAZ
Level 3

Likes

22 likes

Total Posts

35 posts

Correct Reply

2 solutions
Top badges earned
Contributor
Validate 10
Validate 1
Shape 1
Give Back
View profile
KRAZ
Level 3

08-03-2019

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)});

Answers (0)