Javascript error in GA
Issue #15
resolved
When I display a GA report I don't see any mapped user and I find the following error in console: Uncaught TypeError: Cannot read property 'length' of undefined
Viewing the source code I've found that the variable 'MAPPING' is undefinded in the following code
if (typeof USERS !== 'undefined' && MAPPING.length > 0) { var i; for (i = 0; i < USERS.rows.length; i++) { if (USERS.rows[i][GAID] == userId + '') { // 2 equals here not three return USERS.rows[i][MAPPING]; } } }
Comments (5)
-
-
reporter Yes it works,
thank you
-
repo owner Folks, I'll try to roll a fix with this in asap.
-
repo owner - changed status to resolved
Resolved in v0.0.10. Out soon.
-
repo owner I've rolled this in pretty much as is. Sorry for the delay :)
- Log in to comment
Hi Massimo, I had the same issue as you and have a fix for you until David can give a proper solution, it should work if you simply replace the searchForUser function to
Alternatively, you can just type in the field that you want to be used for the mapping, i.e. if you are using a csv file, the column that you would like to be shown below the user id. To do so, just change MAPPING in the following line to the name of the column (don't forget the quotes). return USERS.rows[i][MAPPING];
There are still issues with this solution such as the popup not displaying on hovering the id, but if you are only using two fields (id and username like me for example) that should not be an issue.
Let me know if this solution works for you.
Thanks