> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/advanced/developer/littledata-app-embed-how-it-works.md).

# Littledata’s app embed

This help article shows how Littledata's app embed works and how to activate it from the Shopify admin.

## Littledata's app embed

Littledata loads its tracking script through a Shopify app embed. This page explains what the app embed does, how to turn it on in your theme, and how to check that it's working.

### What is an app embed?

App embeds are blocks that apps add to your Shopify theme. They let an app add features to your store without anyone editing the theme code.

Littledata uses its app embed, called **Littledata Tracker**, to load the tracking script on your storefront. The script tracks page views, product events and other storefront activity, and sends them to your connected destinations.

Littledata moved from a script tag to an [app embed](https://shopify.dev/docs/apps/build/online-store/theme-app-extensions/configuration#app-embed-blocks) in June 2024.

### Why Littledata uses an app embed

* **No theme code changes:** you turn it on and off in the Shopify theme editor.
* **Faster loading:** the script doesn't have to wait for other assets in your theme code.
* **Managed by Shopify:** Shopify adds the script to your theme, which is more secure and reliable than a script tag.

### When to turn on the app embed

You need to turn on the app embed:

* When you install Littledata. The Littledata app asks you to enable it during setup.
* When you switch to a different theme. The app embed is saved per theme, so turn it on again in the new theme.

### How to turn on the app embed

{% embed url="<https://www.youtube.com/watch?v=8a4LLQx6uJ4>" %}

{% stepper %}
{% step %}
**Open your themes**

In Shopify admin, under **Sales channels**, click **Online Store**, then **Themes**.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fvl87oNczDmrkp4SqtiFL%2Fimage.png?alt=media&amp;token=a9475d5f-9391-4c1d-b66c-e170f67f7412" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Open the theme editor**

Find your current theme and click **Customize**.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2F55EopZRtngaUdhXT5NNE%2Fimage.png?alt=media&amp;token=b66c2015-9c28-4372-bdd7-30319ff01054" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Open App embeds**

In the left-hand menu of the theme editor, click **App embeds**.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2F6IoMTFVJzgRCQBzTXOUh%2Fimage.png?alt=media&amp;token=470f1c5b-dde3-45ff-9667-9550df4f8990" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Turn on Littledata Tracker and save**

Search for *Littledata*, turn on **Littledata Tracker**, then click **Save** in the top-right corner.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FSateNLVpPpG1pzINZdLD%2Fimage.png?alt=media&amp;token=ae792db0-2d16-4390-9753-4edd3b89dfdd" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### App embed status in the Littledata app

The Shopify card in the Littledata app shows the status of the app embed.

#### Connected

The app embed is turned on. You don't need to do anything.

#### Not detected

Littledata found that the app embed is turned off in your current theme. Click **Fix now** and follow the steps to turn it back on.

### How to check that the app embed is loaded

{% stepper %}
{% step %}
**Open your store's source code**

Open your storefront in the browser and view the page source, or open your browser's developer tools.
{% endstep %}

{% step %}
**Search for the Littledata block**

Search for `blocks/LittledataLayer`. You should find a comment that starts with `BEGIN app block: shopify://apps/` and ends with `/blocks/LittledataLayer/...`, followed by Littledata's scripts. This works for both the Littledata app and the Segment app.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FBonzSJILe05EPzXlYfax%2Fimage.png?alt=media&amp;token=2c5235aa-60ce-4e64-b8bf-cc2c6ee734a2" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
If you can't find the block, follow the steps in [How to turn on the app embed](https://8e71dccb-61fc-4555-bce8-295290a2739c.frame.claudeusercontent.com/_f/1791977814-39bc/#how-to-turn-on-the-app-embed) again and make sure you clicked **Save**.
{% endhint %}

Need help? Email <help@littledata.io>.

### Related articles

* [Known limitations of Littledata's Shopify tracking](https://help.littledata.io/advanced/developer/known-limitations-of-littledatas-shopify-tracking)
* [How server-side tracking works](https://help.littledata.io/get-started/how-server-side-tracking-works)
