Logo
  • Partner program
  • API
  • Support
Get Relevant Bits

Search

Getting started

Context app embed

Rule types

Analytics

Integrations

Technical

A/B testing

Theme developer guide

Relevant Bits API

Relevant Bits app

Plans & billing

Getting started
Getting started
Third-party Authentication

Third-party Authentication

Third-party Authentication

Rest assured, Context segment rules can seamlessly integrate with Shopify stores that utilize third-party authentication. This allows for a streamlined user experience without compromising on the safety and security of your online store.

To integrate your third-party provider, you will need to add some JavaScript to your Shopify layout file, preferably within the <head> tag. This will provide Context with the Shopify customer ID (for Shopify segments) and/or the customer's email address (for Klaviyo segments) to identify the current shopper.

Here’s an example of what it could look like. Note that the code includes a safeguard to ensure your site doesn’t break if Context isn’t available.

  <script>
    document.addEventListener("DOMContentLoaded", () => {
      const customer = window.relevantbits?.context?.customer;
      if (customer) {
	      customer.id = user.shopifyCustomerId;
        customer.email = user.email;
      }
    });
  </script>

On this page

  • Third-party Authentication
Logo

Version history

Link tree

Privacy

InstagramLinkedInYouTube