- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-01-2018 12:04 PM
Hi!
I am defining the Data Layer for a hotel website, one of the data that they want to collect is the search occupancy, and I can do this by sending the rooms / adults / children in one single variable or use three. Is it better try to use only one or it doesn't matter?
Option A)
search_occupancy
Option B)
search_rooms
search_adults
search_children
Thank you
Solved! Go to Solution.
07-01-2018 01:05 PM
Hi @mike360
It's best practice to keep them separate, exposing data in your data layer at the most granular level, and only grouping them up via extensions when needed by an individual vendor tag.
So in this case, even if you had a requirement for an analytics tag to receive an array in the form [rooms, adults, children], I would personally set them in the data layer individually, and then use a tag scoped extension that would work along the following lines:
b.search_occuancy = [b.search_rooms, b.search_adults, b.search.children]
And then map search_occupancy into the tag. That then gives you the flexibility to play with the logic later, so that if you wanted to separately record a binary flag for "did the search include children" you've got a search_children field you can address directly in a Set Data Values extension to configure a true/false value.
07-01-2018 11:47 PM
Copyright All Rights Reserved © 2008-2023