different behavior of adobe.target.applyOffer 1.x vs 2.x

Avatar

Avatar
Boost 5
Level 2
perrin_ennen
Level 2

Likes

7 likes

Total Posts

9 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
perrin_ennen
Level 2

Likes

7 likes

Total Posts

9 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile
perrin_ennen
Level 2

30-03-2021

The adobe.target.applyOffer function is used inside the adobe.target.getOffer function.

In at.js 1.x I could still set e.g. "action" with e.g. "replaceContent" in the offer option.

 

If I try the same with at.js 2.x - it doesn't work. If I remove the "action" - then it also works with the at.js 2.x for me.

In source code I also found "replaceContent" with the 2.x - and it should actually work, because the applyOffer function was not changed.

 

Does anyone know the problem? Is it really because of this function? What am I doing wrong? Or is the problem something completely different?

 

Best regards
Perrin

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

127 likes

Total Posts

192 posts

Correct reply

81 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

127 likes

Total Posts

192 posts

Correct reply

81 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
rush_pawan
Level 7

30-03-2021

Answers (1)

Answers (1)

Avatar

Avatar
Boost 5
Level 2
perrin_ennen
Level 2

Likes

7 likes

Total Posts

9 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
perrin_ennen
Level 2

Likes

7 likes

Total Posts

9 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile
perrin_ennen
Level 2

31-03-2021

Here is a sample code - which works for me accordingly in at.js 1.x - but not in at.js 2.x. If I would remove the action parameter - then it works accordingly in both.

 

var mbox = 'mboxName';
var selector = document.querySelector('.className');

adobe.target.getOffer({
    mbox: mbox,
    success: function (response) {
        adobe.target.applyOffer({
            mbox: mbox,
            offer: [{
                content: response[0].content,
                action: 'replaceContent'
            }],
            selector: selector
        });
    },
    error: function (status, errorMsg) { 
        console.log(status, errorMsg);
    }
});