Articles in this section
Category / Section

Connect Neostore with Klaviyo

Published:
Updated:

Connect neostore with Klaviyo to enroll more customers in mobile Wallets and send useful messages.

Use cases

5 Integration scenarios :

  • Store card installation status within Klaviyo customer profile
  • Send emails with neostore link (pass, mobile….)
  • Send emails after neostore events (new customer, new pass…)
  • Subscribe/Unsubscribe customer to a one or multiple list
  • Send push update and push notifications from Klaviyo segment via flows

Setup Guide

Neostore configuration

General configuration

klaviyo.png

These values can be retrieved from your Klaviyo configuration here https://www.klaviyo.com/settings/account/api-keys

- `siteId`: corresponds to the Public API Key in the **Public API Key / Site ID** section
- `privateApiKey`: is a new private api key generated for neostore. Required permission are the following :
    - Events **: Full Access**
    
    If you want to update subscription status with Neostore
    
    - List : **Full Access**
    - Profiles : **Full Access**
    - Subscriptions **: Full Access**

Untitled_21.png

  • In server/flows.yml You need to add a new step of type klaviyo in a flow to send events to klaviyo

    for example :

    flows: 
      - type: userRegistration
        name: user
        steps:
          - type: shopify
          - type: pass
            passType : user
          - type : klaviyo
          - type : mail
            mailTemplate: downloadPass
    

List consent configuration

Thanks to Neostore customer registration form, Neostore allows customers to give their consents for marketing purpose. It is possible to configure the extension to automatically add the customer to a Klaviyo list.

  • Single list configuration

    In Klaviyo configuration it is possible to specify a listId.

    This identifier is available in Klaviyo list settings :

    When specified Neostore will automatically subscribe/unsubscribe customer to this list based on field values :

    • when email is filled, field consents_email will subscribe/unsubscribe customer for email to this list
    • when phoneNumberis filled, field consents_sms will subscribe/unsubscribe customer for SMS to this list
  • Multiple list configuration

    It is possible to achieve advanced configuration using the scripting extensibility system. To use, edit or create a new configuration file named /server/script/klaviyo.js. Method GetSubscriptions should be implemented to return all subscription for a current account.

    example :

    function getSubscriptions(account){
    
      var subscriptions = [];  
    
      var newsletterSubscription; 
      if(account['email'] && account['consents_email'] !== undefined)
      {
        newsletterSubscription = newsletterSubscription || { ListId:'WnP7MK' };
        newsletterSubscription.Email = !!account['consents_email']; 
      }
      if(account['phoneNumber'] && account['consents_sms'] !== undefined)
      {
        newsletterSubscription = newsletterSubscription || { ListId:'WnP7MK' };
        newsletterSubscription.Sms = !!account['consents_sms']; 
      }
      if(newsletterSubscription){
        subscriptions.push(newsletterSubscription); 
      }
    
      return subscriptions; 
    }
    
    export default function(context) {
      context.register('extensions.klaviyo.subscriptions.provider', {
        GetSubscriptions: getSubscriptions, 
      });
    }
    

Klaviyo configuration

  • Create a dynamic segment to get all non synchronized profile

    • Go to https://www.klaviyo.com/lists/create and select Segment
    • In the name specify “non neostore profile”
    • In the Definition use “Properties about someone” “neostore.authenticationToken" “is not set "
  • Configure flow to sync existing profiles with neostore

    • Go to https://www.klaviyo.com/flows/create
    • Click on create from scratch
    • use “sync neostore profiles” as name
    • use the “When someone join non neostore profile” trigger
    • Add a webhook (it requires your account to be 2FA compliant)
    • In the webhook destination URL, specify https://app.neostore.cloud/api/<tenantId>/webhooks/listeners/klaviyo/profiles/sync where is the name of your neostore tenant organization
    • Add a new header with
    • In the JSON body use
    {
    "email": "{{ person.email }}",
    "phone_number": "{{ person.phone_number  }}"
    }
    
  • Save and enable the flow

  • To activate this flow on existing profiles

    • edit the flow
    • click on manage flow (on the top) and then on “Add past profiles”
      • choose from beginning
    • and click on “back-populate Flow”

User Guide

Send an email to customer without installed pass

  1. create a dynamic segment that target profile with custom property neostore.wallet.loyaltyCard.Apple does not equals Installed OR neostore.wallet.loyaltyCard.Google does not equals Installed AND neostore.authenticationToken is set

  2. Create a campaign that target this dynamic segment

  3. In the email editor, add a link with the following url

    1. To redirect the customer to a registration form, use

      https://app.neostore.cloud//?neo.authToken={{person | lookup:‘neostore.authenticationToken’ }}

      // example for tenant molia and layout mail: 
      https://app.neostore.cloud/molia/mail?neo.authToken={{person | lookup:'neostore.authenticationToken' }}
      
    2. To redirect the customer to the pass page, use

      https://app.neostore.cloud///confirm?neo.authToken={{person | lookup:‘neostore.authenticationToken’ }}

      // example for tenant molia and layout mail: 
      https://app.neostore.cloud/molia/mail/confirm?neo.authToken={{person | lookup:'neostore.authenticationToken' }}
      

Send an email to customer after they install their pass

  1. Create a new flow
  2. Add a trigger metric trigger and configure it to “Wallet Installed”

Technical Features

  • Add an event to klaviyo profile when a customer register through neostore
  • Add an event to klaviyo profile when a customer install/uninstall a card
    • Events will also be added for existing customer with existing installed cards
  • Synchronize a neostore.authenticationToken custom profile property to new & existing profile. This property allows to send personalized email to customer
Access denied
Access denied