Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Klaviyo native functions

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.

klaviyoSetExternalUserId

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>

klaviyoSetEmail

This function sets the email address for a user profile.

Example:

<script>
	nativeFunctions.klaviyoSetEmail('john@gmail.com')
</script>

klaviyoSetPhoneNumber

This function sets the phone number for a user profile.

Example:

<script>
	nativeFunctions.klaviyoSetPhoneNumber('+3059999999')
</script>

klaviyoSendAttributes

This function sets the specified attributes as true for a user profile.

Example:

<script>
	nativeFunctions.klaviyoSendAttributes(['tag_name'])
</script>

klaviyolDeleteAttributes

This function sets the specified attributes as false for a user profile.

Example:

<script>
	nativeFunctions.klaviyolDeleteAttributes(['tag_name'])
</script>

klaviyoSetAttributes

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>