Skip to main content
Shopify Integration

Connect JUNE with the shop system Shopify

V
Written by Viktor Kutasow
Updated over 10 months ago

To synchronize Shopify with JUNE, a corresponding list and automations must be created in JUNE. Finally, the transfer is enabled in Shopify.

1. Setup in JUNE

First, you create an email list in JUNE.

Here you will learn how to create email lists.

To enable the synchronization between both systems, you have to create mandatory fields in the JUNE list.

  1. Go to Settings in the top bar.

  2. Click on Create Fields. A new menu window opens. For each field, enter the following information:

    • Technical name: accepts_marketing

      Type: Boolean

    • Technical name: marketing_opt_in_level

      Type: Text

    • Technical name: admin_graphql_api_id

    • Type: text

      Technical name: pending_optin

    • Type: Boolean

If email and SMS marketing are used together, create two additional fields. For each field, you enter the following information:

  • Technical name: email_marketing_consent

    Type: Object

  • Technical name: sms_marketing_consent

    Type: Object

Optionally, the following user information can be saved. For each field, you enter the following information:

  • Technical name: first_name

    Type: Text

  • Technical name: last_name

    Type: Text

  • Technical name: accepts_marketing_updated_at

    Type: Date

  • Technical name: tags

    Type: Select

  • Technical name: orders_count

    Type: Number

  • Technical name: state

    Type: Text

  • Technical name: note

    Type: Text

  • Technical name: currency

    Type: Text

  • Technical name: phone

    Type: Text

Once the fields are created, click API in the upper tab and note the Collect Token, List ID and API Token. This token will be used to identify the newly created list in the future.


2. Setup in Shopify

Once the JUNE list is created, it can be linked in Shopify.

For this, two new webhooks need to be created in the Notifications section of Shopify's settings menu. Webhooks should be the last settings option in Notifications.

1. Click on Create Webhook

2. Specify the following information:

3. Webhook 1

4. Webhook 2

With this setting, newly created and updated user data will be transferred to JUNE.

If the double opt-in should be processed in JUNE, it must be disabled in Shopify. To do this, go to the Marketing section and disable the double opt-in.

Depending on whether the opt-in process takes place in Shopify or JUNE, different automations need to be set in JUNE.


3. Create Automations in JUNE

The inventory data in JUNE should now be updated with the data from Shopify.

  1. Go to the JUNE list you created in the first step.

  2. Click on Settings in the top bar.

  3. Activate Update existing collects.

Next, build a journey in the JUNE Workflow Builder.

User is added to the email list

  1. Go to the JUNE list you created in the first step.

  2. Click on Actions in the top bar.

  3. In the Workflow Builder, click Create Action.

  4. Click on the action User is added to the email list.

Depending on whether the opt-in process is processed in JUNE or Shopify, you now need to create different conditions. These Actions have the function of “subscribing” the user and thus enabling them to receive newsletters.

3. a) Opt-In with Shopify

When the opt-in process is done with Shopify, a condition must be set within the action created. Here, the user will then be marked subscribed for JUNE as soon as the relevant information comes from Shopify.

To do this, click Add Condition and select Custom Segmentation.

The Custom Segmentation should look like this:

Unsubscribed

is not

false

Accepts marketing

is

true

Marketing opt in level

is

confirmed_opt_in

In the successful (green) area of the action, you now need to add a service that subscribes the user. Click on Add Service and select Subscribe.

3. b) Opt-In with JUNE

If the opt-in process is to be processed via JUNE, a condition must be created that recognizes the single opt-in from Shopify and thereby sends a confirmation email.

To do this, click Add Condition and select Custom Segmentation.

The Custom Segmentation should look like the following:

Unsubscribed

is not

false

Accepts marketing

is

true

Marketing opt in level

is

single_opt_in

Pending optin

is not

false

If you want users from non-shopify sources to opt-in as well, you need to extend the condition and combine the previous condition into a group.

To do this, click Add Group and create the rules in this group.

The condition type must initially be set to OR so that two conditions can be mixed. Then follows a rule group that recognizes non-shopify users:

Unsubscribed

is not

false

OR

Admin graphql api id

exists

No

Admin graphql api id

is

In the successful (green) area a confirmation mail can now be added. The opt-in process can then be built in the regular way. Here you can learn how to build the DOI process in JUNE.

Additionally, the opt-in status should be saved so that repeated logins or manual adjustments to the user do not result in new emails.

  1. Click Add Service.

  2. Select Update Data.

  3. In the options, select the pending_optin field and check the checkbox that appears.

In the login action of the opt-in process, the value for pending_optin must be reset.

  1. Click Add Service.

  2. Select Update Data.

  3. In the options, select the pending_optin field and uncheck the checkbox that appears.

Receive Unsubscription from Shopify

To process unsubscriptions from Shopify, you need to build another journey.

  1. In the workflow builder, click Create Action.

  2. Click on the action User is added to the email list.

  3. Click Add Condition and select Custom Segmentation.

    The Custom Segmentation should look like this:

Accepts marketing

is

false

Unsubscribed

is

false

4. In the successful (green) area, click Add service.

5. Select Unsubscribe.

Synchronize (Un-)subscribes in JUNE to Shopify

To transfer subscriptions and unsubscriptions from JUNE to Shopify, you need to create an action for each that communicates with Shopify.

  1. Create two actions for this purpose.

    • Action 1: User subscribes

    • Action 2: User unsubscribes

  2. If non-Shopify users are used in the list, a condition must be added to ensure that JUNE can communicate with Shopify. Click Add Condition and select Custom Segmentation.

    The Custom Segmentation should look like the following:

Admin graphql api id

exists

Yes

Admin graphql api id

is not

To transfer the data, click on Add Service and select Webhook. The service must now be configured.

URL:

https://myshop.myshopify.com/admin/api/2022-07/customers/[%=admin_graphql_api_id.replace('gid://shopify/Customer/','')%].json

Please replace “myshop.myshopify.com” with the corresponding URL of the store.

Method: PUT

Headers:

{ "X-Shopify-Access-Token”: “shpat_xxxxxxxx”, “content-type”: “application/json” }

The code “shpat_xxxxxxxx” must be replaced with a corresponding authorization token from Shopify.

Body:

{
“customer”: {
"accepts_marketing": [%=(_unsubscribed?"false”:”true”)%],
“email_marketing_consent”: {
“state”: “[%=(_unsubscribed?"unsubscribed”:”subscribed”)%]”
}
}
}

An integration service will be added to replace the webhook.

🧑‍💻 Contact & Support

Do you need help setting up an integration? Our developers are happy to help. Book your call here.

Did this answer your question?