Analytics Rockstar 🤘

Using Regex to Consolidate Product Variations in CJA

Eric Matisoff, Global Evangelist, Adobe
Eric Matisoff

So here's something cool that I did recently in Customer Journey Analytics that I couldn't keep to myself. In my implementation of the Adobe Experience Platform Web SDK on adobestore.com, I have this issue: lots of products have multiple sizes. Here's an example, the Bezier Full Zip Hoodie.

Here's why products like these cause me, and analysts like you, headaches: when a person visits the page, they haven't selected a product size. So Product Views are attributed to a Product named: bezier full-zip hoodie

But then when the user adds the product to cart, checks out, and purchases, we have the sizing information. Unfortunately the data layer (or CSS that I'm scraping 🙈) has both the product name and size during those events. For example: bezier full-zip hoodie (l)

If you've tried to analyze retail products before, I bet you'll know what this means. Metrics are getting sent to two different product names!

Product Views don't have sizing info, purchase information does!

So if I want to create a conversion rate of Orders per Product View ... I can't!

Never fear - Customer Journey Analytics Data Views are here! 🦸🏻

Of course, I could use Classifications (called Lookup Datasets in CJA) to solve for this, but that's cumbersome and requires effort. I want a quick, retroactive fix that I can set and forget.

So my thinking was: what if I create a Regex that consolidates each of these together and strips the sizing information out? That way all of the Metrics will align to the Product Name without the size!

[here's a secret: my regex skills aren't what they once were. So I used perplexity.ai to help me build this, and it worked seamlessly!]

So I added a Regex Substring to the Dimension:

Applying Regex to a Dimension, easy as ^(1)(2)(3)$

And here's the Regex I used:

^(.*?)(?: \(((?:\d+)?x?[smlXL])\))?$

(just be sure to test it. For adobestore.com, for products that have sizing, we always capture it in parentheses at the end.)

And you want to see how it worked out? Of course you do!

Consolidate those product names!

Isn't that beautiful? Notice how all the Metrics line up correctly and each in a single row of data. So I could create conversion rates, calculated metrics, segments, and more with ease!

And yes, of course I made a separate Dimension (hooray for duplicating Components in Data Views) that focuses on Product Sizing:

Regex and Data Views FTW

Super cool, isn't it? And of course this isn't limited to just sizes or just product names. Any Dimension in CJA that acts this way could easily be consolidated with a little help from our Regex friends.

Go forth and consolidate those Product Names (or whatever!), you Rockstar you!


More Stories

Identifying Traffic from Generative AI / LLMs

AI and LLMs are driving statistically signifcant increases in referrals to brands. We know this. But how can we use analytics tools to tie it to behavior? Learn how these LLM referrals can be identified and how each of the LLMs are .. consistently making that data available to analysts.

Eric Matisoff, Global Evangelist, Adobe
Eric Matisoff

🏴󠁧󠁢󠁥󠁮󠁧󠁿 London Analytics Rockstar 🎤

Surprise! Just when you were starting to get excited for Adobe Summit London I’m thrilled to announce the return of Analytics Rockstar to London! This fun session is sure to be a highlight, bringing together the brightest minds in Adobe Analytics to share their top tips and tricks. Click through to learn what the session is all about and where to go to get involved!

Eric Matisoff, Global Evangelist, Adobe
Eric Matisoff