add flow-hash

This commit is contained in:
Emily
2024-06-10 15:05:05 +02:00
parent e0981cef4a
commit 0c3a25b7e0
6 changed files with 31 additions and 10 deletions

View File

@@ -14,3 +14,12 @@ export function createSessionHash(website: string, ip: string, userAgent: string
const sessionHash = crypto.createHash('md5').update(sessionClean).digest("hex");
return sessionHash;
}
// Track user flow from referrers to cto
export function createFlowSessionHash(project_id: string, ip: string, userAgent: string) {
const dailySalt = new Date().toLocaleDateString('it-IT');
const sessionClean = dailySalt + project_id + ip + userAgent;
const sessionHash = crypto.createHash('md5').update(sessionClean).digest("hex");
return sessionHash;
}