Skip to content

Commit

Permalink
Merge pull request #40 from felipeforte/patch-1
Browse files Browse the repository at this point in the history
Updated hook
  • Loading branch information
Seb35 committed Oct 26, 2023
2 parents 3e9bd0c + 0a11e9f commit 0f665e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hooks.php
Expand Up @@ -170,7 +170,7 @@ public static function addMatomo( $title ) {
// Track username based on https://matomo.org/docs/user-id/ The user
// name for anonymous visitors is their IP address which Matomo already
// records.
if ( self::getParameter( 'TrackUsernames' ) && $user->isLoggedIn() ) {
if ( self::getParameter( 'TrackUsernames' ) && $user->isRegistered() ) {
$username = Xml::encodeJsVar( $user->getName() );
$customJs .= PHP_EOL . " _paq.push([\"setUserId\",{$username}]);";
}
Expand Down

0 comments on commit 0f665e5

Please sign in to comment.