The Local Storage reaction allows you to export segment data to a specific local storage key. This is useful when you want to cache segment data on the device, enabling you to quickly retrieve a CSV list of segments that the user is currently in.

Adding the Local Storage Reaction

If you don’t already have the Local Storage reaction enabled for your project, you’ll need to add it on your Permutive dashboard. 

You need: 


In the Permutive Dashboard:

  1. Login to your project, select ‘Settings → Integrations → Add Integration’
  2. Select Local Storage


The integration will go live in under 20 minutes.

Send your Permutive Segments to a Local Storage key

The Local Storage reaction allows you to send any of your Permutive segments directly to a specific local storage key, where you can use them to quickly retrieve a list of segments a user is currently in, under a unique Permutive segment ID.

You need:

  • Access to the Permutive dashboard
  • A Permutive segment already set up, that you want to push to a local storage key


In the Permutive Dashboard:

Example:

If you have this reaction set up for different segments using the same local storage key, they will be combined as expected.

For instance, you have two segments, 1000 and 1001. Both have the local storage reaction enabled and configured with the key “foobar”. If the user has entered both segments, after executing  
localStorage.getItem("foobar"), you will get [1000, 1001] as the result.

Note:

  • You must add a new reaction for each segment you send to local storage.
  • If you have the DFP integration enabled, the segments sent to DFP will automatically be present in _pdfps local storage key
  • Your segment will now be sent under its segment code, which acts as a unique ID for the segment. Each segment’s code is listed under the ‘Segments’ page in the Permutive dashboard.
Did this answer your question?