Special characters in extensions

ronaldo_junior
Rookie Contributor
ronaldo_junior
We are using one extension to treat the custom variable impression based in data layer itens. Do you have any solution to treat special characters in extensions? Recently we implemented this two lines we had special characters, for instance: b.data_publicacao) && window._gaq.push(['_setCustomVar', 18, 'Dt Publicação', b.data_publicacao, 3]); works, but when i look this custom variable key in Google Analytics, the key is Dt Publica��o and not Dt Publicação: http://i.imgur.com/HfOtoYg.png Best regards,
2 REPLIES 2
Highlighted

Special characters in extensions

son_hoang
Employee Emeritus
son_hoang
Hi Ronaldo, we're looking into this currently but in the mean time please use a tool like this: http://www.web2generators.com/html-based-tools/online-html-entities-encoder-and-decoder to replace any special characters.

Special characters in extensions

fiann_ohagan
Employee Emeritus
fiann_ohagan
Hi Ronaldo, for this case you will need to use a JavaScript encoding rather than an html entity encoding. My colleague Craig Rouse has been using this tool which works very effectively: http://rishida.net/tools/conversion/ - use the JavaScript Escapes tool at the bottom of the page. For example it will convert the string in your code from "Dt Publicação" to "Dt Publica\u00E7\u00E3o" which is the Unicode encoding for the string, and this should give the correct data in your reports. Hopefully this will not be necessary in the future when we fully support UTF-8 in extensions.