I was having problems with google analytics not counting most of my users, and I discovered it was because non English characters are not correctly handled. I added some user profile to my analytics and what was appearing in html source code was:

 <script type="text/javascript" src="http://www.google-analytics.com/urchin.js"></script><script type="text/javascript">_uacct = "UA-1837700-1";__utmSetVar('2716:enboig:Lluís Forns i Puigmartí::C/Montserrat, 12:SANT SADURNI D'ANOIA:08770::938910235:667077619:19/05/1981:A.E. Sant Sadurní:Cap de Pioners/Caravel.les
');urchinTracker();</script>

I supose googleanalytics is the one who should fix this, because when I enter my profile everythins is ok.

Comments

budda’s picture

Maybe this is where

<!--//--><![CDATA[//><!--

//JavaScript goes here

//--><!]]>

comes in to play?

enboig’s picture

I don't understand this solution, I think it should be done with utf8_encode(); or utf8_decode(); somewhere.

budda’s picture

Status: Active » Needs review

I've added utf8_encode to profile values that are output in to the JavaScript segmentation. However I'm not well up on UTF-8 encoding and don't know if this makes it better or worse! The characters appear as a bit of a mess in IE7.

Have a go with the 5.x-dev version of the module. I've committed the change now.

enboig’s picture

Another problem would be if any field have ' in it; maybe an addslashes would be useful.

And thanks for your work

budda’s picture

Assigned: Unassigned » budda
Status: Needs review » Postponed (maintainer needs more info)

Thanks for your input. Have included an addslashes() on the profile field values now.
Did the UTF8 code work at all?

enboig’s picture

didn't have time to test, maybe tomorrow. Thanks a lot for your fast response

enboig’s picture

just tested and it don't work; the code which got written is:

<script type="text/javascript">
_uacct = "UA-1837700-1";urchinTracker();__utmSetVar('2716:enboig:authenticated user:::::::::::');
</script>

And there should be more data (with ' and non-english characters). I looked at user profile and the user 'enboig' have all the data. Maybe a problem with "user profile" module? the fields appear ok in the configuration menu.

hass’s picture

Status: Postponed (maintainer needs more info) » Active

UTF8 is broken... see http://drupal.org/node/178765. I have added a patch there.

Committed fix into D6 branch.

hass’s picture

Status: Active » Fixed

Should be fixed, if not please reopen.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.