# Shopify

> Connect a Shopify store to sync customers, email consent, orders, products and abandoned checkouts, track product views, show Emailit forms on your store and add coupon codes to Shopify discounts. Alpha: open to the Emailit team only.

The Emailit app for Shopify connects your store to an Emailit workspace. Customers, their email consent, orders, products and abandoned checkouts stay in sync without any code, so the [Commerce](/docs/commerce/) features work with your Shopify data: revenue from each email, product blocks, coupons, and automations for new orders and abandoned carts.

> **Commerce is in alpha:** Commerce, including the Shopify app, is open only to the Emailit team while we test it. See [Who can use Commerce](/docs/commerce/#who-can-use-commerce).

## Connect your store

1. **Install the app.** On **Email Marketing → Commerce**, open the **Shopify** tab and select **Install in Shopify**, or find Emailit in the Shopify App Store.

2. **Open Emailit in your Shopify admin.** Shopify opens the app after the install. Select **Connect to Emailit**.

3. **Pick the workspace.** In the tab that opens, sign in to Emailit if you need to, choose the workspace for this store and select **Connect**. You need to be an Admin of the workspace.

4. **Turn on the app embed.** Back in the app, select **Turn on the app embed** and save your theme, so Emailit forms can show on your store.

Emailit then imports your products, customers and orders. Orders go back 60 days, or longer when Shopify allows it. The import doesn't start automations or send webhooks, so years of customers don't all get a welcome email. From then on, changes in Shopify reach Emailit within seconds.

A store connects to one workspace, and a workspace has one store.

## What syncs

| From Shopify | In Emailit |
| --- | --- |
| Customers | Contacts, with first and last name. Customer tags become contact tags such as `shopify:vip`. |
| Email marketing consent | Membership of the store's audience. See [Email consent](#email-consent). |
| Orders | Orders with their items, discount codes, refunds and status (placed, paid, fulfilled, canceled or refunded). Each one is credited to the email that brought it, and fires `order.placed` or `order.updated`. |
| Products | Products with price, image, link, inventory and collections. The collections become categories for [product blocks](/docs/campaigns/products-and-coupons/). |
| Carts and checkouts | Carts with a link back to them. See [Abandoned checkouts](#abandoned-checkouts). |

## Email consent

Connecting creates an audience for the store, or uses the one you pick. Customers who accept email marketing in Shopify join it, and customers who unsubscribe in Shopify leave it. Customers who never opted in are contacts but not subscribers, so campaigns don't reach them.

It works the other way too. When someone unsubscribes in Emailit, from that audience or from everything, Emailit unsubscribes the customer in Shopify. New subscribers of the store's audience are added to Shopify as subscribed customers. When both sides change, the newer change wins.

## Abandoned checkouts

Shopify sends Emailit a checkout as soon as the buyer enters an email address. Emailit stores it as a cart and creates the buyer as a contact if needed. If no order follows within **Cart abandoned after (minutes)** in Commerce settings, the cart becomes abandoned: it fires `cart.abandoned` and starts automations with the **Abandoned a cart** trigger. The order converts the cart, and the automation's next emails are skipped.

In the email, `{{cart.checkout_url}}` is Shopify's recovery link, which takes the buyer back to their checkout. Turn off Shopify's own abandoned checkout email so buyers don't get two.

Shoppers who leave before checkout can get the reminder too. Shopify reports every cart change to Emailit, and the Emailit pixel tells it whose cart it is. A cart of a contact who subscribed, or who came from one of your emails, is abandoned after the same delay, and its `{{cart.checkout_url}}` opens a cart with the same items. Other visitors' carts wait until they enter an email at checkout, so the pixel can't be used to aim reminders at any address.

## Track visitors on your store

The Emailit pixel runs on every page of your store and in checkout. It records product views, recognizes visitors who arrive from your emails, and links them to the email they enter at checkout or in an Emailit form. That powers the **Recently viewed by the contact** product source and segments by product views. The pixel follows your store's cookie consent: Shopify only runs it for visitors who allow marketing and analytics.

Tracking visitors is part of the Pro and Business plans, like all [event tracking](/docs/events/). Orders, customers and abandoned checkouts sync on every plan.

## Browse abandonment

Product views of contacts who subscribed, or who came from one of your emails, start automations with the **Viewed a product** [trigger](/docs/automations/triggers/#viewed-a-product). The **Browse abandonment** template waits two hours after a visit, then shows the contact what they looked at with `{{products "recently_viewed"}}`. It runs at most once a week for each contact, and stops when they order or leave a cart.

## Signup forms

With the app embed on, the [forms](/docs/forms/) you publish in Emailit show on your store. A form that adds people to the store's audience makes them subscribed customers in Shopify too.

The app embed can also load the Emailit tracking script, for themes that send their own events with `emailit("track", ...)`. Turn on **Load the Emailit tracking script** in the app embed's settings.

## Back in stock

Shoppers can ask for an email when a sold-out product is back.

1. **Add the block.** On the **Shopify** tab, or in the app in your Shopify admin, select **Add the block to product pages**. Shopify opens your theme editor with the **Back in stock (Emailit)** block on the product page. Place it, change its texts if you like, and save.

2. **Create the automation.** In Emailit, create an automation from the **Back in stock** template, with the **Product back in stock** [trigger](/docs/automations/triggers/#product-back-in-stock), and pick the email to send.

The block shows when the selected variant is sold out. Shoppers enter their email, and can also tick a box to subscribe to your news. When Shopify reports the variant available again, Emailit starts the automation once for each shopper who asked. Its email can show the product with `{{payload.object.product.title}}`, `{{payload.object.product.url}}` and `{{payload.object.product.image_url}}`.

The form sends to Emailit through your store's app proxy at `/apps/emailit`. A shopper can wait for up to 25 products at a time.

## Coupon codes in Shopify

A [coupon](/docs/commerce/coupons/) can add its codes to a Shopify discount, so every code an email hands out works at checkout. Open the coupon and select **Link to Shopify**, then either:

- **Create a discount**: Emailit creates it in Shopify, a percentage or an amount off, with an optional minimum order. For unique codes, each code works once.
- **Use an existing discount**: Emailit adds the codes to a discount you already have, keeping its value and conditions.

Codes you add or generate later go to Shopify too. When a buyer uses a code, the order marks it as redeemed in Emailit.

## Settings

Workspace Admins change these under **Email Marketing → Commerce**, on the **Shopify** tab. In the app in your Shopify admin, your staff can turn the updates to Shopify and the tag copying on or off, but can't change the audience or add subscribers to Shopify.

| Setting | What it does |
| --- | --- |
| **Audience for Shopify subscribers** | Where customers who accept email marketing go. |
| **Update Shopify when someone subscribes or unsubscribes in Emailit** | On by default. Turn it off to sync consent only from Shopify to Emailit. |
| **Add new subscribers of this audience to Shopify as customers** | On by default. Creates a Shopify customer for each new subscriber Shopify doesn't know yet. |
| **Copy Shopify customer tags to contacts** | On by default. Tags arrive as `shopify:<tag>`. |

## Disconnect or uninstall

**Disconnect** on the **Shopify** tab, or in the app, stops syncing and removes the Emailit pixel. What was already synced stays in Emailit, and you can connect again from the app.

When you uninstall the app in Shopify, syncing stops at once. 48 hours later, Shopify asks apps to delete the store's data. Emailit then deletes the orders, products and checkouts that came from Shopify. Contacts stay, because they're your audience in Emailit.

When a customer asks your store to erase their data, Shopify tells Emailit. Emailit deletes the contact and removes the email address from their orders.

---
Source: https://emailit.com/docs/commerce/shopify/
