Reply
Highlighted
Occasional Contributor
Posts: 33
Registered: ‎02-12-2016
Accepted Solution

Retrieve libraries names in JS?

Hi
Is there a way to retrieve the names of libraries that have been loaded by a profile in Javascript? We would like to expose this in a data layer attribute for easier testing / debugging. 
Many thanks for your ideas

Reply
0 Kudos
Occasional Contributor
Posts: 120
Registered: ‎12-11-2015

Re: Retrieve libraries names in JS?

[ Edited ]

I'm afraid it's not possible, @jmbolfing, - the publish engine treats inherited objects in the same way as it would have if they were created within the profile itself. There's nothing in the published utag.js that makes mention of any source libraries.

One possible workaround would be to create an All Tags extension in each profile/library which runs the following:

b.library_list = (b.library_list || "") + "main" + ";"

Changing the "main" to the name of the current library.. Which would then create a UDO variable that would end up containing a semi-colon delimited list of all the libraries that were inherited.

Occasional Contributor
Posts: 33
Registered: ‎02-12-2016

Re: Retrieve libraries names in JS?

[ Edited ]

Many thanks @UnknownJ for sharing your thoughts. Your proposed solution sounds feasible. We are going to run a test with this.