Urgent Help Needed
Hi Guys,
We need to access the data from local storage for creating audiences.
We have tried using custom code as well using local storage option in Data element so that we can access and create the audience in Adobe Target, but we're not able to achieve.
Please find screenshot and code for your reference.
// Example code to extract audiences from the JSON
try {
var jsonData = JSON.parse(localStorage.getItem('tealium_va')); // Replace 'yourLocalStorageKey' with the actual key used to store the JSON in local storage
if (jsonData && jsonData.audiences) {
jsonData.audiences; // This is the correct way to use the value in Adobe Launch data element code
} else {
console.log('Audiences data not found');
}
} catch (error) {
console.error('Error extracting audiences:', error);
}
Audience creation in Adobe Target:
Please help me out.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
There are a few different ways you could do this. Hard to say without knowing your full implementation.
https://experienceleague.adobe.com/docs/target-dev/developer/implementation/methods/methods-to-get-d...
One option that I'm personally familiar with is the Adobe Target v2 extension.
You can create 2 separate rule actions to Add Params to Page Load Request followed by Fire Page Load Request.
In the Add Params to Page Load Request action you can add a parameter which references a data element to fetch the data from localStorage.
You should then be able to reference that parameter in an Adobe Target audience under Custom.
For the parameter dropdown you'd select the name of the parameter that you chose in the Add Params to Page Load Request action.
I don't have any experience with the other methods so hopefully somebody more experienced can chime in.
Best of luck!
There are a few different ways you could do this. Hard to say without knowing your full implementation.
https://experienceleague.adobe.com/docs/target-dev/developer/implementation/methods/methods-to-get-d...
One option that I'm personally familiar with is the Adobe Target v2 extension.
You can create 2 separate rule actions to Add Params to Page Load Request followed by Fire Page Load Request.
In the Add Params to Page Load Request action you can add a parameter which references a data element to fetch the data from localStorage.
You should then be able to reference that parameter in an Adobe Target audience under Custom.
For the parameter dropdown you'd select the name of the parameter that you chose in the Add Params to Page Load Request action.
I don't have any experience with the other methods so hopefully somebody more experienced can chime in.
Best of luck!
I'm guessing that if you were to use the following:
That it's probably what the Adobe Target v2 extension is doing under the hood.
Views
Likes
Replies
Views
Like
Replies