Solved : Wrong quotation marks and antislashes included in the Piwik request



I’m tracking custom variables with Piwik but in the generated request to Piwik server, here what I get :

/piwik.php?action_name=my_action&idsite=2&rec=1&r=632817&h=18&m=26&s=12&url={“1”:"[“Var1”, “VAR0003719412”]",“2”:"[“Var2”, “0”]"}&gt_ms=277

The parameter which is matching to the custom variable is very weird because it has misplaced quotation mark : {“1”:"[“Var1”, “VAR0003719412”]",“2”:"[“Var2”, “0”]"} and antislashes coming from nowhere.
Result : these custom variables are not saved by Piwik.

When I try to send a request manually with this value : cvar={“1”: [“Var1”,“VAR0003719412”] ,“2”:[“Var2”,“0”]}, it works well.

I track my custom variables in a standard way :

_paq.push([‘setCustomVariable’, 1, ‘Var1’, ‘N°Identifiant’, ‘page’]);
_paq.push([‘setCustomVariable’, 2, ‘Var2’, ‘Montant’, ‘page’]);

Any clue of where did come from these quotations marks and antislashes ?

Thanks for any help,


(Matthieu Aubry) #2

you are likely using Prototype which is known to be buggy re JSON. Please update Prototype to a more recent version.


I updated it and it works well :slight_smile:

thank you !