How-to guide
Sales data for data stories
Let SemPost read only daily totals from a store's orders for data stories; see what it reads, what it keeps and when it deletes them.
When you switch on sales data for a store, SemPost turns the store's orders into daily totals: how many orders came in each day, the revenue, the refunds and the units sold; and per product, the units and the amount sold. Data stories use these totals to tell your store's sales in figures. No single order and no customer details are kept.
Sales data works for a WooCommerce store connected with a REST key, and for a Shopify store connected with your own app. The SemPost app from the Shopify App Store doesn't read orders yet; for a store that came with it, the section says that the permission to read them comes with a later version of the app.
An example
Mert's WooCommerce store is connected to SemPost with a REST key. In Settings › Store connections, he switches on Sales data in data stories on the store's row. SemPost reads the last 400 days of orders, the oldest first, and adds up each day. Half an hour later the row says Read since …, with the time of the last reading next to it. From then on, SemPost reads new orders and refunds about every hour. SemPost has no name or address of Mert's customers; only daily totals such as "12 November: 9 orders, 1 refund, 14 units".
Switch on sales data
Find the store's row
Go to Settings › Store connections. Each store's row has a Sales data in data stories section, which says in short what SemPost keeps and what switching off deletes.
Switch it on
Switch on the section's switch; SemPost says …: its sales will be read. If the store waits for a permission or a key, the section says what to do. See the Shopify and WooCommerce sections below.
Wait for the first reading
SemPost reads the orders by the day they were placed, the oldest first. Meanwhile the section says Reading the orders. The first reading takes from a few minutes to a few hours, depending on how many orders the store has. Once it's done, the section shows Read since … and the time of the last reading.
Owners and admins switch sales data on and off; everyone in the workspace sees the section. After the first reading, SemPost reads the store's orders about every hour. Whichever day a new order, a refund or a cancellation changed, SemPost reads that day again whole and renews its totals.
How far back it reads
| Store | First reading |
|---|---|
| WooCommerce, with a REST key | The last 400 days (about 13 months) |
Shopify, with your own app, with read_orders and read_all_orders | The last 400 days |
Shopify, with your own app, with read_orders only | The last 60 days |
| WooCommerce, without a key (Store API) | Can't be read; add a key with Add a REST key |
| The SemPost app from the Shopify App Store | Can't be read yet |
A day's totals are deleted 400 days after that day.
What counts
Cancelled orders, orders whose payment never came, wholly refunded orders and test orders don't count. Revenue is the total of the orders' amounts, taxes and shipping included. Refunds are kept apart and lower the net revenue. A product's amount is the total of its order lines after discounts, before taxes and shipping; a partial refund isn't split over the products. Only orders in the store's currency count; currencies are never converted.
Days follow your workspace's time zone, which you see in Settings › Workspace.
What SemPost reads and keeps
Of each order, SemPost uses only when it was placed, its status, its total, its refunds, its currency, whether it's a test order, and the products, units and amounts on its lines. It never asks for a customer's name, address, email address or phone number. It doesn't keep the orders it reads: it keeps only the daily totals and each product's daily units and amount, for 400 days. The details are in SemPost's Privacy Policy.
Switch off sales data
Switch off the section's switch and confirm with Switch off and delete. SemPost no longer reads the store's orders and deletes all the daily totals it read, at once. If you switch it on again, the store is read from the start.
The totals are deleted in these cases too:
- When you remove the store from SemPost, at once.
- When the store can't be read for 30 days: while it waits to be connected again, for a permission or for a key. The section says The store couldn't be read for 30 days, so its totals were deleted. Once the store can be read again, it's read from the start.
- When sales data is closed for your workspace, for all its stores.
Each deletion shows in the Audit log with the number of days deleted. Where SemPost itself deleted them, the actor is System.
Shopify store connected with your own app
Your app needs read_orders. With read_all_orders added too, SemPost reads the last 400 days instead of the last 60.
The Connect a store dialog lists both under Optional (for sales data in data stories; read_all_orders opens 13
months):.
- In Shopify's Dev Dashboard, open your app's Versions page, add both permissions to the access scopes and release the version. Add them to the access scopes themselves, not to optional scopes: Shopify grants an optional scope only to an app that asks for it itself.
- Approve the new permissions in your Shopify admin.
- In SemPost, press Check on the store's row.
With read_orders alone, the section shows a note that starts with Only the last 60 days of orders are read now.
If you add read_all_orders later, Check has the store read again from the start, 400 days back. An app created in
the store's own organization doesn't need Shopify's approval for this permission. Orders count as protected customer
data in Shopify; such an app normally reads them without a review.
WooCommerce store
A REST key reads orders too when the WordPress user it belongs to may see orders, such as an Administrator or a Shop manager.
If you connected the store without a key (Store API), you don't need to remove it and connect it again:
- In the WordPress admin, open WooCommerce › Settings › Advanced › REST API and add a key with Read permissions, that is a read-only key. SemPost never changes anything in your store; don't give it a key that can write.
- In SemPost, press Add a REST key on the store's row.
- Paste the consumer key (it starts with
ck_) and the consumer secret (it starts withcs_), then press Add the key.
SemPost tries the key on the store first. From then on, the store counts as connected with a REST key: its rules keep running, and your coupons are read too. The keys are stored encrypted, like those given when connecting a store, and are only sent to the store's address.
If something goes wrong
The note in the section says what to fix:
- Add read_orders and read_all_orders to your Shopify app's version, … Add the permissions as described above and press Check.
- The store doesn't show its orders. … In Shopify, approve the app's latest version in your admin; if it goes on, ask Shopify's support to let your app read protected customer data. In WooCommerce, give the key's user the Shop manager or Administrator role. Then press Check.
- The store was connected without a key, so its orders can't be read. … Add a read-only key with Add a REST key.
- The store needs connecting again. … Bring the store back as described in Store checks, reconnecting and removing.
- The store didn't answer a few times; SemPost will try again. You don't need to do anything. The totals are as of the last reading that worked.
- SemPost's Shopify app doesn't read orders yet. … For a store that came from the Shopify App Store, sales data can't be switched on until a version of the app that reads orders.