feat: better check for pixel

This commit is contained in:
Nevo David 2024-12-16 16:05:04 +07:00
parent c3fa9826a1
commit 60b70ead52
1 changed files with 7 additions and 2 deletions

View File

@ -38,8 +38,13 @@ export class TrackService {
const current_timestamp = Math.floor(new Date() / 1000);
const userData = new UserData();
userData.setClientIpAddress(ip || user?.ip || '');
userData.setClientUserAgent(agent || user?.agent || '');
if (ip || user?.ip) {
userData.setClientIpAddress(ip || user?.ip || '');
}
if (agent || user?.agent) {
userData.setClientUserAgent(agent || user?.agent || '');
}
if (fbclid) {
userData.setFbc(fbclid);
}