Sync Shopify Customer's Metafield to Klaviyo's profile

tomoyanakano

Tomoya Nakano

Posted on January 8, 2023

Sync Shopify Customer's Metafield to Klaviyo's profile

Hi, I would like to introduce the way to sync Shopify customer Metafield to Klaviyo profile.

What is Metafield

Metafield is additional information you can add to Shopify objects like products and collections.
If you don't familiar with it, please check this article.

What is Klaviyo

Klaviyo is a Marketing Automation Platform that can send emails and SMS to your customers.
You can make segments by custom properties like location or activities(added to cart and so on...) and send emails to them.
if you know more about klaviyo please check this page

What is the advantage of syncing Metafield to Profile

The advantage of syncing Metafield to Profile is that as mentioned, you can make segments by customer's metafield and Implement marketing initiatives to them.
For example In clothes shop, by adding Metafield about customer's height or weight, You cloud send mail magazine personalized for customer's body types.

How to sync

Step1: Integrate Klaviyo App to Shopify store

If you've integrated it already, please follow step2.

First of all, you have to install Klaviyo app to your shopify store. Then, install this app
Once the integration is complete, you should be able to see Klaviyo's App Embed on the Shopify theme customization page.

Please activate it.

Step2: Add Snippet

When the Klaviyo setting is activated, objects named _learnq are available in javascript.
Please check it via console.

You can use Klaviyo Identify API with the object so please add below snippet.

<script>
  var _learnq = _learnq || [];

  {% if customer %}
  _learnq.push([
    'identify',
    {
      $email: '{{ customer.email }}',
      // add Metafield here
      $birthday: '{{ customer.metafields.namespace.birthday.value }}'
    },
  ]);
  {% endif %}
</script>
Enter fullscreen mode Exit fullscreen mode

To learn more about the Klaviyo Identify API, please visit this page.

Step3: Load Snippet

Load the snippet in theme.liquid then customer's Metafields would sync to Klaviyo.

{%- render 'klaviyo-identify' %}
Enter fullscreen mode Exit fullscreen mode

You can find the value of metafield in Klaviyo's profile page.

Profile parameters

Conclusion

You can implelement powerful marketing automation by integrating customer's Metafield with Klaviyo.

If you use Klaviyo for your store's marketing, Please consider using Metafield and integrate it with Klaviyo.

💖 💪 🙅 🚩
tomoyanakano
Tomoya Nakano

Posted on January 8, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related