Reply
Highlighted
Visitor
Posts: 17
Registered: ‎03-09-2016
Accepted Solution

Reset UDO value in single page application

[ Edited ]

Hi @brian_kranson,

 

we are using Tealium iQ in a Angular single page application (through the Tealium Angular module). This workes fine, but now I ran into problems. I want to submit additional parameters to the Google Analytics tag and created an UDO variable to map to the tag and store the value. I use the "Set data value" extension to populate this parameter on the corresponding page. But after the value is set the first time, it gets send every page view.

 

I tried do debug the code to understand the behaviour. The extension is scoped to the GA tag and the value is set in the b object local to this extension as expected. In the u.send function in the GA tag template the values of the b object are set to the corresponding parameter name in the u.data object. If I inspect the u.data object at the end of the u.send function, I see that the parameter is only set on the specified pages, not on the other ones. However, if I look in the Google Analytics network call, I can see that the parameter is transmitted on every page view after it is set the first time.

 

Am I missing something? It seems to me that the values of u.data are used to create the call, so I don't understand how a value that doesn't exist in this object can get send to GA.

 

I even created a second "Set data value" extension which is executed befor the other one to clear the value, but this didn't help. Can you give me some hint what I am doing wrong?

 

Best regards,

Andreas

 

 

Reply
0 Kudos
Employee Emeritus
Posts: 232
Registered: ‎09-01-2015

Re: Reset UDO value in single page application

@ahrasch

Our engineers have been working on utag to make it work better with single page apps.  Check the version of your utag

// from developer console on your webpage use the following
utag.cfg.v

This article desribes some of the version updates:

https://community.tealiumiq.com/t5/uTag/SERIES-utag-js-Release-Notes/ta-p/5549

https://community.tealiumiq.com/t5/uTag/utag-js-version-4-40-and-4-41-Release-Notes/ta-p/12946

 

Reply
0 Kudos
Visitor
Posts: 17
Registered: ‎03-09-2016

Re: Reset UDO value in single page application

[ Edited ]

Hi @brian_kranson,

 

although I saw the release notes some time ago, I missed the updates to SPA websites.

We are currently still using 4.39 and I will try to update to the current version this week and see, if this solves our problem.

 

Thanks a lot,

Andreas

Reply
0 Kudos
Visitor
Posts: 17
Registered: ‎03-09-2016

Re: Reset UDO value in single page application

Hi,

 

I had the chance today to do the upgrade to utag version 4.41 and deploy it to our dev environment. It didn't solve our problem but at least I could debug enough to identify the cause of the problem, although I am not sure how to solve this.

 

The problem is, that in the single page application, the Google Analytics tracker object is only created once at the first page load. If I set a parameter, it will be send on every following page view and it only ever changes its value if I overwrite it with a different value. The reason for this is, that Tealium iQ only maps parameters if they are populated.

So, even if I create an extension that sets the parameter to undefined or an empty string, Tealium iQ won't update the tracker object.

 

This behavior is fine for the mapping of query string parameters of several tags, however it doesn't work with the stationary Google Analytics object.

I have no clue how to solve this without messing with the tag template.

 

Any input would be appreciated.

 

Greetings,

Andreas

Reply
0 Kudos
Visitor
Posts: 1
Registered: ‎03-23-2016

Re: Reset UDO value in single page application

Instead of setting an empty string  try passing an empty array ['']. This should work.

Visitor
Posts: 17
Registered: ‎03-09-2016

Re: Reset UDO value in single page application

Thank you @tarunkumar605 for this suggestion. As this problem is still unsolved, I will definitely try this.

Reply
0 Kudos
Community Manager
Posts: 470
Registered: ‎08-26-2015

Re: Reset UDO value in single page application

Hi @ahrasch. Here are some articles about how to create arrays in Tealium. 

 

Please let us know if this helps or not.

 

Hello @tarunkumar605. Thank you so much for the assistance!

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

Re: Reset UDO value in single page application

Hi @ahrasch

 

So, I think what you actually need is to change your mappings from "contentGroup#" to "pageview-contentGroup#".

What this will do is stop using the "old/defualt" behaviour, and change to setting this on a pageview event, instead of the "set" command, which, as you are seeing, will send that value on all requests.

 

Other options include "transaction-"/"link-"/"enh_".

 

I've put a request in to update the toolbox to reflect these options, so it will be similar to that of the metrics/dimensions mappings tabs.

 

Adrian

 

Visitor
Posts: 17
Registered: ‎03-09-2016

Re: Reset UDO value in single page application

Hi @adrian_browning,

 

 

many thanks for your answer. I haven't seen any documentation of this feature, but it seems to be exactly the solution I was looking for. After a first quick test it looks very promising that this will solve our problems.

 

Do you have any further information regarding this feature?

 

Andreas

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

Re: Reset UDO value in single page application

@ahrasch

 

I'm afraid there isn't any further information around this. I will request that the document:

 

https://community.tealiumiq.com/t5/Tags-and-Client-side/Google-Universal-Analytics-Tag-Advanced-Mapp...

 

Is updated with the information.

 

Adrian

Visitor
Posts: 17
Registered: ‎03-09-2016

Re: Reset UDO value in single page application

@adrian_browning

 

You should definitely update your documentation as I think there will be others encountering this problem too.

 

However I accepted your previous post as a solution as it does what I was looking for.

 

Thanks again,

Andreas