Updating user attributes via UE.pageHit method
Learn how to use the UE.pageHit method to update your users data.
What is UE.pageHit
It’s a JavaScript method that:
logs a page view for the user
updates user’s attributes values
logs and event (optionally)
Using UE.pageHit() method you can update user’s attributes in User.com. Just add an attribute and a value, as in the example below. Remember to use proper formatting!
UE.pageHit({
"email":"test@user.com"
})
How it works
UE.pageHit() sends a request to User.com server and updates a URL (generates a new page view) and passes user attributes with certain data. It's the equivalent of a user navigating to a new page.
What if I don't want to log a page view? Then you can use the client update method.
userengage('client.update', {attribute: 'value'});
Attributes you can’t update
Using methods mentioned above allows us to update certain attributes only. Here’s the list of ones you cannot change:
Page views (integer)
First seen (date & time)
Last seen (date & time)
Date created (date & time)
Date updated (date & time)
Key (string)
Email mx valid (boolean)
Web push notification (boolean)
Country (string)
Region (string)
City (string)
URL (string)
IP address (string)
Referrer (string)
Timezone (string)
Device (fixed choices; 1 - mobile, 2 - desktop, 3 - tablet)
Browser (string)
Browser language (string)
Browser version (string)
Os type (string)
Hostname (string)
Screen resolution (string)
Additional notes
You can update all user’s attributes with empty values. There is one exception, and it’s user_id attribute, which is not allowed to be set to empty. We use user_id as the main unique user identifier, so it must remain undefined or take a unique value.