Expand my Community achievements bar.

Join Cristinel Anastasoaie, Timothy Furlow, and Brent Kostak, WEDNESDAY, 2/28/24 @8am PT for the next Adobe Target Community Q&A Coffee Break on topics from the recent High Performance Recommendations Webinar PT 2 of the ongoing Target Personalization Maturity Webinar Series

The reason why offer code doesn't render on the page

Avatar

Employee Advisor

There could be certain scenarios where you have the expected offer code in the Target response but this specific offer code is not rendering on the page.

Below is an illustration of an HTML offer code as the response from a regional mbox 'toolmbox'.

Untitled.png

In this particular situation, the HTML offer is the result of loading a remote offer code when user sends a request to Target server with the given custom mbox. However, it will not render on the page until a selector is specified in the applyOffer. For example: "selector": '#mainContainer'.

This selector actually tells Target about the place where to load the resultant offer on receiving the response successfully. The offer code in response will replace the content captured by the specified selector in applyOffer.

 

		adobe.target.getOffer({
                        "mbox": "toolmbox",
                        "params": {
                            "option": 1
                        },
                        "success": function (offer) {
                            adobe.target.applyOffer({
                                "mbox": "toolmbox",
                                "offer": offer,
                                "selector": '#mainContainer'
                            });
                        },
                        "error": function (status, error) {
                            console.log('Error', status, error);
                        }
                    });

 

In this case, the HTML offer (which is loading as the result of a remote offer code via 'toolmbox') will replace the content block with ID 'mainContainer'.

In the nutshell, if you want to render the offer code from your Target response then you should specify the selector as the place where your offer code(response) can go and sit.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies