Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Error in piwik.js function logEvent

$
0
0

@hamburger wrote:

if you call the function

logEvent(category, action, name, value, customData, callback)

without parameter it shout gives an error.

(logConsoleError(‘Error while logging event: Parameters category and action must not be empty or filled with whitespaces’);

But it doesn’t. Because the line

trim(String(category))

returns 9 (the length of the word categorie) when categorie is empty
So the error will never been showed.

var category;
console.log(“String(category)).length:”,String(category).length); // gives String(category)).length: 9

testes in firefox 61.01 and windows 7

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles