Reply
Highlighted
Visitor
Posts: 4
Registered: ‎10-09-2015

Data Layer Enrichment - Multiple Products

Hello,

we are using the Data Layer Enrichment Feature. 

Our use case is easy: we have products with "id" and we retrieve the "product_category"

Everything is working as expected with single products.

 

We have pages with multiple products and would like to retrieve several categories.

I tried to pass an array like this:

id: ["prod_id_1", "prod_id_2"]

 

Unfortunatly, this is not working, and the file retrieved is prod_id_1,prod_id_2.js

 

I couldn't find any further information in the documentation.

 

Can you help on this issue?

 

Thanks

Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

[ Edited ]

Hi @Stevs

Apologies for a late response.

The API will accept a string of data, and that string must reference a single value.

The issue with what you are trying to do is that the response of each successive call will overwrite that response of each prior call.

So let's say you have ["prod_id_1", "prod_id_2"]

And the lookup output for prod_id_1 is:

{
"prod_sku":"abc123",
"prod_name":"product abc"
}

While the lookup output for prod_id_2 is:

{
"prod_sku":"xyz789",
"prod_name":"product xyz"
}

Notice how the output keys are the same.

When the logic runs, prod_id_1 will be imported and set prod_sku and prod_name, then when the following prod_id_2 call occurs it will overwrite prod_sku and prod_name. Meaning you'll only ever have one set of keys available.

Does that help answer you question?

Cheers,
-Dan

Visitor
Posts: 4
Registered: ‎10-09-2015

Re: Data Layer Enrichment - Multiple Products

Hi @dan_george,

thanks for your reply.

So this means that it is not possible to retrieve information from several products on one page?

Best,

Steven

Reply
0 Kudos
Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

@Stevs

 

Not at this time. The API was built to serve single item info, for example on a product page.

 

We would have to make an update to the system to handle a lookup on an array of data, and to append to an array of data. I have submitted the appropriate request to Engineering for review.

Reply
0 Kudos
Occasional Contributor
Posts: 81
Registered: ‎11-06-2015

Re: Data Layer Enrichment - Multiple Products

We would also need this feature by the way. We have product lists, or a user can have multiple products in his cart or checkout, so there is always the need to grab multiple product's data in one request.

To only allow this for one product is a bit short-sighted imho.

Visitor
Posts: 3
Registered: ‎11-10-2016

Re: Data Layer Enrichment - Multiple Products

Hi @dan_george,

 

do you have an update on the status on the lookup for multiple products? This is quite a critical issue for us.

 

Moreover: We would like to be able to do the data layer enrichment not only on pageload, but also on subsequent utag.link events. If I understand correctly, this is not possible right now. Could you please advice on how to get that working and / or extend the extension?

 

If both features (multiple products + lookup on link events) were available, this would be a great plus compared to other TMS imho.

 

Thanks and best,

Kai

 

 

Reply
0 Kudos
Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

@loldenburg @KaiB

 

This request has been submitted but not yet added to our roadmap. Please escalate again through your channel manager or account manager so that it can follow the appropriate process. They will need to own the communication within the business and between the agency or client.

 

Cheers,

-Dan

Reply
0 Kudos
Visitor
Posts: 3
Registered: ‎11-10-2016

Re: Data Layer Enrichment - Multiple Products

@dan_george

 

Thanks for your reply!

I suppose you are relating to the first issue (multiple products).

 

What about the second issue (DLE on link events)? Is there something we / Tealium can do to make that possible?

 

Thanks and best,

Kai

Reply
0 Kudos
Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

@KaiB

 

I'm going to have to assume the issue you're running up against is that when DLE API is ran on page load, the returned DLE data isn't persisted in the global utag.data object for post page load event tracking. If so, please let me know if the below is what you are looking for.

 

Add utag.ut.merge(utag.data,b,1); to a JS extension scoped to All Tags and Before Load Rules so that the DLE data is persisted.

 

Merge DLE DL to Page DL.png

 

Then pass that DLE data as part of the utag.link call. For example, if you have a jQuery extension that tracks the Add to Cart event and you want to pass the product_img_url and product_availability DLE variables then you would configure the extension as follows:

 

DLE Add to Cart.png

 

Hope this helps!

 

Cheers,

-Dan

Reply
0 Kudos
Occasional Contributor
Posts: 81
Registered: ‎11-06-2015

Re: Data Layer Enrichment - Multiple Products

Thanks, we know how we can persist stuff that is in utag.data (we usually do not want to persist everything, so ut.merge is too much.

The issue we are having is that a lot of times, the product ID which is used for the lookup is not known on page load (which is when the DL Extension runs). It is only known later. Example: User comes on page with unconfigured product. https://siroop.ch/computer-elektronik/smartphone-handy/smartphone/apple-iphone-7-0715736
The product ID (UDO var prod_cid) is known only after he does configuration, e.g. selects how many GB the smartphone shall have. When he selects the GB, the shop triggers a utag.link call with the prod_cid (which is now known). But there is no new page load. Since we cannot query the DLE after the page load anymore, we cannot pull down the DLE information associated with the product in question.
Reply
0 Kudos
Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

@loldenburg

 

Thanks for the additional information. 

 

If you run utag.view instead of utag.link then the DLE API will run. Would that work for you? utag.view will run extensions scoped to All Tags and run the API.

 

Cheers,

-Dan

Occasional Contributor
Posts: 81
Registered: ‎11-06-2015

Re: Data Layer Enrichment - Multiple Products

[ Edited ]

Hi @dan_george, thanks, we had thought about this ourselves already, but this would require all kinds of major changes to the current tracking. We don't want to change everything around just because of one new feature. 

And it would cover only this one use case. There will be others in the future where the ID of a product will only be known later and not on the pageview, so I don't want yet another ugly workaround for these things (Tealium is full of workarounds anyway already)...

Lukas

Reply
0 Kudos
Tealium Employee
Posts: 639
Registered: ‎09-01-2015

Re: Data Layer Enrichment - Multiple Products

@loldenburg @Stevs @KaiB

 

I have submitted the appropriate request to Engineering to support DLE for utag.link events.

 

Cheers,

-Dan

Reply
0 Kudos