Expand my Community achievements bar.

SOLVED

Regarding Local Storage in Adobe Target and Launch

Avatar

Level 1

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.

user8723_0-1708950379903.png

 

// 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:

user8723_1-1708950459123.png

Please help me out.

 

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 3

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.

https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/client/target-v2/overvie...

https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/client/target-v2/overvie...


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!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3

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.

https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/client/target-v2/overvie...

https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/client/target-v2/overvie...


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!