lifetime spend for each category

billysballo
Rookie Contributor
billysballo

Hi,

I would like to understand the lifetime spend for each category, i m interested in Rings vs Necklaces.

However the product category is set only on PLP and PDP pages.

So I am trying to understand how to get lifteime spend for each category given that the on confirmation page  i have the product name and id but not the category.

After that being able to get the spend for Rings and Necklaces

Thanks

4 REPLIES 4

lifetime spend for each category

aaqib
Silver Contributor
Silver Contributor aaqib

Hey Billysballo,

To get the lifetime order total for each category, I have added some of the Set data value extension for each category product and make some configuration on the extensions. And all these extensions are set to the data layer variable called Category (which in term used in Audience Stream to get the product Category).

Next, I have Created a Visitor Scope Tally attribute called Lifetime spend for each category,

  •  Enrichment: Increment Tally: For Tally Lifetime Spend For each Category increment the value based on Category by Order_total.
  • Rule: Category is Assigned

After running the trace I'm able to get the lifetime total spend for each category. But I don't know how to extract it for further use. This is what I did to get the Lifetime Spend For Each Category. Professionals, If this is not the correct/exact way to get the Lifetime Spend For each Category, please provide some alternative for this.category extension.PNGcategory product.PNGtally Lifetime spend for each category.PNG

Md Aaqib Uddin
Sᴏғᴛᴡᴀʀᴇ Iᴍᴘʟᴇᴍᴇɴᴛᴀᴛɪᴏɴ Sᴘᴇᴄɪᴀʟɪsᴛ

lifetime spend for each category

billysballo
Rookie Contributor
billysballo

I will give it a go along with another solution I thought.

I will keep you posted.

Highlighted

lifetime spend for each category

Tealium Employee

@billysballo Your problem is that product_category is not present in the data layer on the order confirmation page, only product_id.  Presumably, both product_id and product_category are present on the PLP and PDP pages, as well as the add to cart event?

In that case, one approach is to "remember" the most recent product_id and product_category and then use this "remembered" value when incrementing the Tally on the confirmation page event, if the product_id there matches the most recently "remembered" product_id.

You could either do this "remembering" client-side (using for example a Persist Data Value extension) or in AudienceStream (using for example a pair of visit String attributes)

@aaqib Your solution works because you are able to directly work out the product_category based on the product_id, which I think is different to @billysballo 's problem.  To answer a question you had about extracting values from the tally, there is an enrichment available on Number that pulls out the value of a particular key in a Tally and stores it in the number.  You may find the following diagram useful - https://community.tealiumiq.com/t5/Universal-Data-Hub/AudienceStream-Visit-and-Visitor-Attributes-an...

lifetime spend for each category

aaqib
Silver Contributor
Silver Contributor aaqib
Thanks, @mark_reddin for this information, I'll go through the attachment.
Md Aaqib Uddin
Sᴏғᴛᴡᴀʀᴇ Iᴍᴘʟᴇᴍᴇɴᴛᴀᴛɪᴏɴ Sᴘᴇᴄɪᴀʟɪsᴛ