Hi,
Validating contexts (cx) or unstructured data (px) parameters in your browser network tab currently takes three steps:
- Copy the BAS64 string
- Decode the BASE64 (e.g. through a decoding website)
- Beautify the JSON data to make it more readable.
For our team, I’ve created a JavaScript bookmark that does this automatically:
- Copy the BASE64 sting
- Hit the bookmark and fill out the string.
- The JSON object is pretty-printed in your console.
Here’s the code you can set as the URL in your bookmark
javascript:(function()%7Bvar input %3D prompt('Snowplow base64 input')%3Binput %3D atob(input)%3Bconsole.log(JSON.stringify(JSON.parse(input)%2C null%2C 2))%7D)()
I hope it can help some of you out.