Creating Notebooks
The ShopifyQL Notebooks app enables you to query your store data and create visualizations. By combining different data visualization with text blocks, you can create reports on your store called notebooks. For example you can create a notebook to explore your total product sales, and a notebook to help you understand which products are making the biggest contribution to your profit margins. You can create as many notebooks as you want.
On this page
Install the ShopifyQL notebooks app
Go to theShopifyQL Notebooks pageon the Shopify app store.
ClickAdd app.
Log in to the Shopify store that you want to install the ShopifyQL Notebooks app on.
To agree to share the required data with the ShopifyQL Notebooks app, clickInstall app.
After the app is installed on your store, you cancreate a new notebook.
Creating a new notebook
A notebook is a set of content blocks that you create and put in the order that you want. There are different types of blocks that you can use to create your notebook:
You can use a combination of data visualizations such as graphs and charts, as well as text to best tell the data story.
Create a new notebook
From your Shopify admin, clickSettings>Apps and sales channels.
From theApps and sales channelspage, clickShopifyQL Notebooks.
ClickOpen app.
ClickCreate notebook.
By default, the new notebook has a single codeblock. Do either of the following:
- Choose a template for your code block
- Write your own code block
可选:添加额外的代码块或文本块s to your notebook by hovering your mouse where you want to add the block, and selecting eitherText blockorCode block.
To save your notebook, click the
...
button, and then clickName.Enter a name for your notebook, and then clickSave.
After you save your notebook, you canexport the notebook, oredit the notebook.
Text blocks
A text block lets you add styled text or a static image to your notebook. Text blocks can be used for headings in your notebooks, introductions, or descriptions of data visualizations.
Code blocks
Code blocks let you add a a query to your notebook that uses the ShopifyQL query language to return data about your store. In your code block you can choose how the data displayed in your notebook.Learn more about using ShopifyQL for Notebooks.
Templates
Templates are pre-written ShopifyQL queries that you can use as-is, or as a starting place to create your own query. When you create a code block, you can select a template by clickingTemplatesand selecting a template from the list. Templates are available for a number of data visualizations, for example:
- Sales over time
- Top converting products
- Top selling products
Autocompletion
ShopifyQL Notebooks automatically provide suggestions for your query as you write your code block. Click the suggestion to add it to your query, or continue typing to add your own code.
Export a notebook
From your Shopify admin, clickSettings>Apps and sales channels.
From theApps and sales channelspage, clickShopifyQL Notebooks.
ClickOpen app.
In theNotebookssection, click the notebook that you want to export.
Click the
...
button, and then clickPresentation mode.ClickExport.
Your notebook is downloaded as a PNG file.
Edit a notebook
From your Shopify admin, clickSettings>Apps and sales channels.
From theApps and sales channelspage, clickShopifyQL Notebooks.
ClickOpen app.
In theNotebookssection, click the notebook that you want to edit.
Make changes to the notebook by editing blocks, adding new blocks, or deleting blocks.
ClickSaveto save your changes.
Using Liquid to reference data
You can create dynamic data stories using Liquid, Shopify's templating language, to reference data in your ShopfyQL Notebooks. A reference is a data element from a ShopifyQL code block, and it can be edited using Liquid within a text block.
Steps:
From your Shopify admin, clickSettings>Apps and sales channels.
From theApps and sales channelspage, clickShopifyQL Notebooks.
ClickOpen app.
In theNotebookssection, click the notebook that you want to edit.
Find the text where you want to create a reference.
ClickAdd referenceto open the Liquid editor.
Enter theLiquidcode for the data element that you want to reference.
Use the autocomplete suggestions for available references, rows, and columns to ensure accuracy.
ClickApplyto save your reference.
Running a Notebook
When you load a ShopifyQL Notebook, you are presented with code and text blocks in their previously-run state. You can use this view to understand prior work, but it might not show the latest data. To view current data, use one of the following options:
Re-run individual code blocks: To get the latest data, re-run the relevant code blocks by clickingRunfor each code block.
Run all the code blocks: Update all of the data in your notebook and run all of the code blocks by clickingRun all.
When re-running a code block, any references linked to it are updated automatically, so your data stories show the latest information.