Populate Optimizely custom tag (audience) with UDO

jeroen_visser
Visitor
jeroen_visser

Following the documentation on synchronous loading of Optimizely in Tealium (https://help.optimizely.com/hc/en-us/articles/206420397-Implementing-Optimizely-with-Tealium-iQ-or-E... I've implemented Optimizely successfully. But I also would like to push UDO data from Tealium to a custom tag in Optimizely.  Therefor Optimizely suggests the following on https://help.optimizely.com/hc/en-us/articles/201876450#custom_tagshttp://developers.optimizely.com/javascript/reference/index.html#custom-tag

 

 

​<script>
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["customTag", tagKey, tagValue]);</script>
<script src="//cdn.optimizely.com/js/xxxxxxxx.js">

Putting this in the tag doesn't result in the right effect:

 

//tealium universal tag - utag.sync ut4.0.##UTVERSION##, Copyright ##UTYEAR## Tealium.com Inc. All Rights Reserved.
##UTSYNC##
document.write(' <script>window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["customTag", "lidmaatschap", u.data.Lidmaatschap]);</script> //using UDO variable lidmaatschap
​​<script type="text/javascript" src="//cdn.optimizely.com/js/3509580682.js></script>');

 

1 REPLY 1
Highlighted

Populate Optimizely custom tag (audience) with UDO

Tealium Employee

@jeroen_visser This part should be in your utag.sync.js template:

 

document.write( '<script type="text/javascript" src="//cdn.optimizely.com/js/3509580682.js></scr' + 'ipt>');

 

The rest appears to belong in a JS Extension (outside of a document.write)