Visit Count Profile Script
Sep 11, 2017This profile script counts the number of times that a user has visited your site. Note that it checks to make sure that this is a new session before incrementing the visitCount. This keeps the script from incrementing on each page view and only adds to the count once per visit on the first page of the session.
The name of this script would be visitCount.
if(user.sessionId!=user.getLocal('lastSessionId')) {
user.setLocal('lastSessionId', user.sessionId);
return (user.get('visitCount') || 0) + 1;
}
user.setLocal('lastSessionId', user.sessionId);
return (user.get('visitCount') || 0) + 1;
}