Expand my Community achievements bar.

Who Me Too'd this topic

Avatar

Level 1

 

Hello,

 

We have a activity only for visitors with a particular profile parameter. But this data point does not exist until several seconds after the page has fully loaded. This means the first pageLoad request made to Adobe Target (at.js 2.x) is missing these parameters - and the visitor fails to qualify for the test.

 

We have some code that will scrape the DOM for all the necessary data points, so we want to make a second request to the Adobe Target servers. This time with all the parameters in order to fetch the activity and then apply it.

 

For A4T to work correctly all calls to Adobe Target should use the same supplemental ID as the original Adobe Analytics Page track supplemental ID. This works fine for the default first pageLoad request.

 

But when we try to make this second request using adobe.target.getOffers and a hardcoded supplementalDataId it is ignored, and instead a new supplementalDataId is created.

 

How can we ensure the supplementalDataId isn't randomly recreated, and instead uses what we set it to?

 

 

 

 

    adobe.target.getOffers({
            request: {
                experienceCloud: {
                    analytics: {
                        supplementalDataId: "4A3B4159AD0B6F95-7F996DA189DD5694" // hardcoded to test if this gets passed to Adobe Target
                    }
                },
                execute: {
                    pageLoad: {
                        parameters: {
                            level: 'advanced'
                        },
                        profileParameters: {
                            score: 2 // example parameter that we scraped from DOM several seconds after page loaded
                        }
                    }
                }
            }
        })
        .then(response => adobe.target.applyOffers({ response: response }))
        .then(() => console.log('Success'))
        .catch(error => console.log('Error', error));

 

 

 

 incorrectId.png

We have manually ran the above code snippet in the console, and expected the network tab to show the same supplementalDataId as we have hardcoded. But it wrongly showing as '7F3635E16781A866-10994B8473BC3DE7'

 

References;

https://experienceleague.adobe.com/docs/target/using/integrate/a4t/troubleshoot-a4t/a4t-troubleshoot...

https://experienceleague.adobe.com/docs/target/using/implement-target/client-side/functions-overview...

https://developers.adobetarget.com/api/delivery-api/#operation/execute

 

Who Me Too'd this topic