I have a react application which has Adobe Target SDK deployed on the server side and using at.js 2.x.
How can I print the Activity ID or Activity Name on the browser console so that it's useful for debugging or checking if the correct offer is applied?
Below is my current TriggerView function:
I would like to console log the Activity ID after the success call.
export function triggerView(viewName, mbox) {
if (typeof adobe !== 'undefined' && adobe.target && typeof adobe.target.triggerView === 'function') {
adobe.target.getOffer({
"mbox": mbox,
"success": function (offer) {
if (offer.length) {
adobe.target.applyOffer({
"mbox": mbox,
"offer": offer
});
}
},
"error": function (status, error) {
console.log('Error', status, error);
},
"timeout": 3000
});
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Pravinrams1
You can also look for the requested info using Browser Network tab and search for “delivery” inside the search box. Please see in the below screenshot in response Token object you can able to see activity.id, name, experience name and other info.
Views
Replies
Total Likes
@Pravinrams1 Here is the syntax to fetch the Activity name and Activity ID in the custom code
1. Campaign Name: ${campaign.name}
2. Campaign ID: ${campaign.id}
Hope this helps to achieve your scenario
Views
Replies
Total Likes
@dsingh16 Sorry, I am new to Adobe Target. Where do you put this custom code?
Views
Replies
Total Likes
@Pravinrams1 When you create Target activities, you will see an option as Modification Type, choose the modification type as Custom code, and add code in the head section.
Views
Replies
Total Likes
Hello! It looks like it's only VEC but I am using form method, is there a similar option for "Form-based" as well?
Views
Replies
Total Likes
Hi @Pravinrams1
you can achieve this through Response tokens.
RT helps you and can provide the information include details about the activity, offer, experience, user profile, geo information, and more.
Here is the link of ttMETA plugin that you can inject directly into your HTML page or through tag manager and print all the Activity ID or Activity Name and other info on console.
If in case if you're using the AEP Web SDK then here is the solution.
Hope this helps.
Views
Replies
Total Likes
Hi @Pravinrams1
You can also look for the requested info using Browser Network tab and search for “delivery” inside the search box. Please see in the below screenshot in response Token object you can able to see activity.id, name, experience name and other info.
Views
Replies
Total Likes
Thank you, @Gokul_Agiwal I can see it in the network tab once I enabled the RT.
Views
Replies
Total Likes
Great @Pravinrams1 Glad to know that it worked for you. !!!
Views
Replies
Total Likes
Views
Like
Replies
Views
Like
Replies