Wexlyn
Back to the docs

E-commerce

Connecting a Shopify store

Two ways to connect a store, what Wexlyn does on each page of the shop, and how to confirm it works with a test order.

Wexlyn reads orders, refunds and customers from your store, places its tracking script on every storefront page and a pixel on checkout, and ties each order to the ad click that produced it. Nothing is written back to Shopify.

There are two ways to connect. Connect with Shopify is the one-click path through the Wexlyn app on the Shopify App Store. A custom app connects a store without the App Store, for example while the listing is still under review, or on a store that prefers its own app. Both end in the same place: a store card under Settings → Integrations → Shopify.

Way 1: Connect with Shopify

  1. Open Settings → Integrations → Shopify.
  2. Under Connect a Shopify store, type the store's .myshopify.com domain (not the custom domain) and press Connect with Shopify.
  3. Shopify asks you to approve read access. Approve. You land back on the Shopify page with the store's card.

Wexlyn registers the order webhooks and activates the checkout pixel on its own. The card shows what is on:

  1. Press Turn on tracking. Your theme editor opens with the Wexlyn app embed selected: switch it on, press Save in the editor, come back and press Check. The row changes to Tracking active once a storefront page view has arrived.
  2. Press Sync orders to import the last 60 days of orders (more when Shopify has granted the app full order history).

If you came from the App Store "Install" button instead of from Wexlyn, Shopify sends you to Wexlyn first; sign in or create your account and the store is attached to it on the next page.

Way 2: a custom app

A custom app belongs to one store and needs no App Store review. It has no app extensions, so the script and the checkout pixel are pasted once by hand (steps 3 and 4).

Shopify moved custom app creation out of the store admin. Settings → Apps and sales channels → Develop apps now only points to the Dev Dashboard, and a new custom app no longer shows a permanent access token: it has a Client ID and a Client secret, and Wexlyn requests the access token with those two.

1. Create the app in the Shopify Dev Dashboard

Do this signed in as the store owner or a staff member who may develop apps. The app has to be created in the store's own Shopify organization; an app made in somebody else's organization (an agency's, or Wexlyn's) is refused by Shopify.

a. Open the Dev Dashboard. Go to dev.shopify.com/dashboard. If you belong to several organizations, pick the one that owns the store (bottom left). Click Apps in the left menu, then Create app at the top right.

b. Choose "Create app manually". The menu offers Shopify CLI first; take the second entry, Create app manually.

c. Fill the form. Only four things need your attention; leave the rest as it is.

  1. App name: Wexlyn
  2. App URL: https://app.wexlyn.ai
  3. Embed app in Shopify admin: untick it
  4. Scopes: paste read_orders,read_customers,read_products,read_checkouts,read_customer_events,read_themes. Add read_all_orders too if Select from list offers it and you want order history older than 60 days.
  5. Click Create app.

Leave Allowed redirection URL(s) empty, Use legacy install flow unticked and the Webhooks API version on the newest one.

d. Release it. Shopify asks to release the first version. Leave the description empty and click Release.

e. Install it on the store. Open the app's Overview page. On the Installs card click Install app (in some organizations the button reads Test app).

Pick the store.

Shopify lists what the app may read. Click Install. Shopify then opens Wexlyn in the same tab; that is expected, you can close it.

f. Copy the two values. Back on the app's Overview page (or its Settings page), the Credentials card has a copy button for the Client ID (1) and one for the Client secret (2).

g. Say which customer data the app reads. Orders carry the buyer's name, email, phone and address, and Shopify only sends them to an app that has declared it reads them. For an app that is not on the App Store this is a setting you save, not a review. From the app's Overview page click the Distribution card (it opens the app's other pages), then API access requests → Protected customer data access → Request access. Click Select on Protected customer data (1), tick Analytics and Marketing or advertising, Save; then do the same for Name, Email, Phone and Address (2). You can leave step 2 of that page ("data protection details") untouched.

If you skip this, the store still connects, but its card in Wexlyn shows Order webhooks missing; do the step, then press Register webhooks on the card.

2. Paste both into Wexlyn

Open Settings → Integrations → Shopify and fill the Connect a store with a custom app form: the store's .myshopify.com domain (1), the Client ID (2) and the Client secret (3). Leave the last field (Admin API access token) empty and click Connect (4).

Wexlyn requests an access token from Shopify, checks it against the store, stores everything encrypted and registers the order webhooks. The token lasts 24 hours and Wexlyn renews it by itself.

If Shopify answers that the app and the store are not in the same organization, the app was created under a different Shopify account than the store's: create it again from the store's own account.

An older custom app (created inside the Shopify admin before this change, with a token that starts with shpat_) still works: paste its API secret key as the Client secret and its Admin API access token into the last field, and leave the Client ID empty.

3. Add the tracking script to the theme

The store's card shows a script tag under Add the tracking script with a copy button.

  1. In Shopify open Online Store → Themes, press the ⋯ menu on the current theme → Edit code.
  2. Open layout/theme.liquid, paste the tag just above </head>, press Save.
  3. Visit the storefront once, then press Check on the card. It reports the last storefront page view.

4. Add the checkout pixel

Checkout pages cannot run theme code; Shopify's custom pixel covers them. The card shows the code under Add the checkout pixel.

  1. In Shopify open Settings → Customer events → Add custom pixel, name it Wexlyn.
  2. Paste the code, press Save, then Connect.

When the Wexlyn app is approved on the App Store the store can switch to Way 1 at any time; settings, tags and history stay.

Confirm it works with a test order

  1. Open the storefront, view a product, add it to the cart and check out. On a development store Shopify's Bogus Gateway accepts card number 1 with any future date.
  2. Within seconds the order appears under CRM → Sales with its first and last source. Click the row: the person's journey shows the storefront visits, product view, add to cart, the checkout steps and the order.

What each part does

PartWhat it doesWay 1Way 2
App embed / theme scriptRecords every storefront page view, click id and UTM, and identifies the visitor at the first form or checkoutSwitch on in the theme editorPaste the tag in theme.liquid
Checkout pixelRecords checkout started, contact and payment steps and the purchase on Shopify-hosted pagesAutomaticPaste the custom pixel
Order webhooksOrders, paid, updated, refunds, new customers, uninstallAutomaticAutomatic
Sync ordersImports past orders (60 days, or all with full order history)Button on the cardButton on the card
Application tag!shopify-<store> on every lead, sale and visit from the store, so reports and the CRM can be filtered per storeAutomatic, editableAutomatic, editable

Sending store events to ad platforms

Once a store is connected, every ad platform's Conversions tab offers Send add to cart, Send checkout started and the order itself as a Purchase. Each one goes out with the cart or order value and is matched on the click id captured on the visit and on the person's hashed email, so Meta and Google optimise on real revenue. See Integrations for the destination setup.

Troubleshooting

  • Order webhooks missing: on Way 1 this means Shopify has not yet granted the app protected customer data access for that store; press Register webhooks again later. On Way 2, when the message mentions protected customer data, the app has not declared which customer data it reads: do step 1g above, then press Register webhooks. When it names a scope, the app is missing read_orders or read_customers: add it in a new version of the app in the Dev Dashboard, release it, approve the change on the store, then press Register webhooks again.
  • Pixel not active (Way 1): press Activate pixel on the card. The web pixel needs the read_customer_events and write_pixels scopes, which the App Store app has.
  • Tracking never turns active: on Way 1 open the theme editor again and confirm the Wexlyn embed is switched on in the published theme; on Way 2 confirm the tag is in the published theme's theme.liquid, not a draft.
  • Orders arrive without a source: the buyer's first visit happened before tracking was on, or the storefront is on a domain the tracking script could not read the cookie for. Later orders from that person will be credited once a tracked visit exists.
  • Sales counted twice: the same orders also reach Wexlyn through a payment processor connection (Stripe, PayPal). Keep one of the two for that store; Shopify's order webhooks already carry the payment.