I have some Piwik JS code embedded in my SharePoint sites. I am submitting a username using the 'setUserId' command and that works perfectly everytime. When I added in a Visit Dimension to submit a user's Department (userDepartment) the value only gets added to the dimension about 50% of the time, the other 50% is listed as "Value Not Defined". I have checked and the user's department does get pulled it just for some reason sporadically adds information.
The 2 ways I have tried submitting the code to the Dimension and both work around 50% of the time:
_paq.push(['setCustomDimension', 1, userDepartment]);
_paq.push(['setCustomDimension', customDimensionId = 1, customDimensionValue = userDepartment]);
Can you create a small test file to reproduce this issue consistently? We need a way to reproduce as for us, setting custom dimensions value works. Thanks in advance...
Hey Matt, thanks for the response! Let me know if you need anything else :) . We consistently get a around a 50% success rate. I did some more diving to see if there was a trend on specific sites or for specific users but there was no trend. From the files I have attached, I have a picture of how we are using the code in the MasterPage, a picture of our Piwik information, and a txt file of the js file that is referenced in the masterpage
once we implement https://github.com/piwik/plugin-CustomDimensions/issues/32 then the report will not show the
Value not defined rows, except if they were specifically set to empty/null. Maybe this will help. Otherwise, we don't know what the issue is, until you have some more idea how to reproduce. Thanks
Thanks Matt, but the value of the dimension isn't null. I can reproduce the issue with any dimension that I use. Also even if I add a value directly into the statement like:
_paq.push(['setCustomDimension', customDimensionId = 1, customDimensionValue = 'Test Value']);
The code will still register it as a view and add the user's name/visit information to Piwik but the Dimension will most likely not be updated with 'Test Value', it would most likely be Not Defined even though there is a value.
I appreciate your continued support on this Matt! Thanks!!
Thanks. What we need now is a small HTML file where the issue can be reproduced. Could you prepare such file , and post it here with instructions how to reproduce? we'll investigate ASAP then
Hi Matt! So unfortunately since it's SharePoint I can't just provide an html page ince it's more of a system. Would you have any advice as to why this is happening? Because it grabs the user information, completes the code, submits the information but randomly doesn't submit the dimension
this should have been fixed in https://github.com/piwik/plugin-CustomDimensions/issues/32 a year ago