Shopify widget automations
Shopify widget automations act on your store when a visitor interacts with a widget: they create the visitor as a Shopify customer, apply a discount to their cart, add a product, tag the order through a cart attribute, or record their tracking consent. They appear under Action in → Shopify when you add an automation to an element.
Available on: Shopify (with the Personizely app installed)
Automations
Automation | What it does | Runs |
|---|---|---|
Add customer | Creates or updates a customer in Shopify | On Personizely's servers |
Apply discount | Applies a discount code, or a newly generated unique code, to the visitor's cart | In the browser |
Add a product to the cart | Adds one unit of a product variant to the cart | In the browser |
Set cart attribute | Sets a cart attribute that's saved on the order | In the browser |
Change user consent | Grants tracking consent in Shopify's customer privacy settings | In the browser |
They run on the element's event like any Widget automations: a click, a submit, a timer or cart progress reaching its goal, or a wheel landing on a segment.
Add customer
Creates a customer in your Shopify admin from the visitor's profile, usually on a form submit.
Option | What it does | Values / default |
|---|---|---|
Customer tags | Tags added to the customer | One or more tags without commas; default Personizely |
What's sent to Shopify:
- Contact details: email, phone, first and last name.
- Marketing consent: for a new customer, email and SMS marketing are set to subscribed when the visitor gave that consent, and not subscribed otherwise (single opt-in). For an existing customer, consent is only ever switched to subscribed, never removed.
- Birthdate, when collected, in the customer metafield personizely.birth_date.
- Tags: your tags are added to the customer's existing tags.
If a customer with the same email already exists, that customer is updated. If the email and phone point to two different people, Personizely doesn't merge them. The visitor needs at least an email, a phone number or a name.
Apply discount
Option | What it does | Values / default |
|---|---|---|
Discount code | The code to apply, e.g. SUMMER30 | Text |
Generate an unique code | Create a new single code instead of applying a fixed one | Off by default |
Discount | (Generate) The Shopify discount the new code belongs to | Your store's discounts |
Prefix | (Generate) Text at the start of each generated code | e.g. PLY- |
- The code is applied to the visitor's cart straight away and remembered in their browser, so it's also added to Buy now buttons of Products (cross-sell and upsell) elements.
- Each run generates a new code. With Generate an unique code, every time the automation runs, Personizely creates a new code under the selected discount in your Shopify admin, made of the prefix and 10 random characters.
- To show the code to the visitor as well, use a Coupon and discount codes element; it can apply the code automatically too.
Add a product to the cart
Option | What it does | Values / default |
|---|---|---|
Product | The product to add | Product picker |
Variant | (products with several variants) The variant to add | Variant list |
- One unit is added each time the automation runs.
- The cart count and total update on most themes. Some cart drawers only show the new item after they're reopened or the page reloads.
- The add doesn't fire the Add to cart trigger of other widgets.
Set cart attribute
Option | What it does | Values / default |
|---|---|---|
Attribute name | The cart attribute to set | Text, e.g. Source |
Attribute value | Its value | Text, e.g. Personizely Popup |
Cart attributes are saved on the order and shown in the order's additional details in Shopify. An attribute with the same name is overwritten. Use them to see which orders came through a widget, or to pass a choice such as "Gift note requested" to your fulfillment.
Change user consent
Option | What it does | Values / default |
|---|---|---|
Privacy consent to change | The consent categories to grant | Measure performance (analytics), Personalize marketing (marketing), Store your preferences (preferences); all selected by default |
The selected categories are recorded as granted in Shopify's customer privacy settings, the same place Shopify's cookie banner stores them. Unselected categories aren't changed, so this automation never withdraws consent. It needs Shopify's customer privacy features to be active on your storefront, as they are when you use Shopify's cookie banner. See Cookies and consent.
Behavior details and limitations
- Browser automations run before the event is saved. Apply discount, Add a product to the cart, Set cart attribute and Change user consent run as soon as the visitor clicks or submits. Add customer runs on Personizely's servers a moment later.
- They also run in preview. The browser automations run in Preview and QA campaigns, so testing them changes your own cart, and generated codes are real codes in your admin. Add customer doesn't run in preview.
- Disabled integration. If the Shopify integration is disabled, these automations are greyed out and don't run.
Examples
- Signup to customer: Form with Add customer (tag newsletter-popup) and Track widget conversion.
- One-click upsell: Button "Add the matching belt" with Add a product to the cart and Close widget.
- Unique welcome code: Form submit → Apply discount with Generate an unique code on a 10% discount, followed by a thank-you step that says the discount is in the cart.
- Order source tag: Set cart attribute Source = Exit popup on the offer button.
Troubleshooting
- Customer isn't created → the visitor has no email, phone or name yet, or the Shopify integration is disabled.
- Discount isn't on the order → the code doesn't apply to the products in the cart, or the discount has ended or reached its usage limit in Shopify.
- Too many codes under one discount → Generate an unique code creates a code on every run. Add a Frequency rule rule so the widget doesn't repeat for the same visitor.