MobiLoud's Klaviyo integration includes several native functions that allow you to manage user profiles and attributes with ease. In this guide you will find a list of available functions with examples and more details on how to use them.
This function sets a new external ID for a user profile and deactivates any old profiles associated with the previous external ID.
Example:
<script>
nativeFunctions.klaviyoSetExternalUserId('12345')
</script>
This function sets the email address for a user profile.
Example:
<script>
nativeFunctions.klaviyoSetEmail('john@gmail.com')
</script>
This function sets the phone number for a user profile.
Example:
<script>
nativeFunctions.klaviyoSetPhoneNumber('+3059999999')
</script>
This function sets the specified attributes as true for a user profile.
Example:
<script>
nativeFunctions.klaviyoSendAttributes(['tag_name'])
</script>
This function sets the specified attributes as false for a user profile.
Example:
<script>
nativeFunctions.klaviyolDeleteAttributes(['tag_name'])
</script>
This function sets attributes with custom values for a user profile. Ensure you use JSON.stringify() to format the values correctly.
Example:
<script>
nativeFunctions.klaviyoSetAttributes(JSON.stringify({'tag_name_1': false, 'tag_name_2': true}))
</script>