# Littledata’s app embed

## What is an app embed?

App embed blocks are customizable components provided by apps that can be embedded into the Shopify theme.

They allow apps to inject functionality directly into the theme without requiring manual code changes. Littledata needs this functionality to load tracking scripts

## Why add Littledata's app embed

{% hint style="success" %}
If you installed Littledata before June 2024, you'll be prompted to add our app embed when you login.
{% endhint %}

Littledata updated our tracking script to use an [app embed](https://shopify.dev/docs/apps/build/online-store/theme-app-extensions/configuration#app-embed-blocks) in June 2024.

This is an improvement on the previous script-tag implementation

## Benefits of an app embed

* **Seamless integration**
  * Easily add and manage analytics through the Shopify theme editor without touching the theme code.
* **Improved loading speed**
  * Optimized loading ensures better performance compared to script tags.
  * Using app embeds, the script is loaded faster not needing to wait for other assets in the theme code.
  * In our tests using average internet speed, results state that the app embed has reduced the loading time of the trackers by **\~94%.**
    * App embed loading time: **\~400ms**
    * Script tag loading time: **\~6.6s**
* **Improved security**
  * App embeds are managed by Shopify's backend, offering more secure and reliable script injection.

## When to enable the app embed?

* After installing our app and getting past the paywall, you will be prompted to enable Littledata's app embed.

![Littledata's in-app guide to enable the app embed](/files/GUvr5KRUZycDAULlOK3p)

* If you are **completely moving to a different theme**, you will need to reactivate Littledata's app embed following the video or the steps mentioned below.

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

1. From your **Shopify** admin, under **Sales Channels,** click **Online Store** to open the dropdown and select **Themes**.

![](/files/LNMA3NmR1X4X3VH2eOSB)

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

![](/files/vXFy3rz65rq1jCg4VWZh)

1. Once you open the editor, in the left hand menu, select **App Embeds**.

![](/files/rwU0yPNlYgfEwyt3ETlx)

1. Search for *Littledata* and enable it. Make sure to **Save,** on the top right corner.

![](/files/DrrbKf2HIaphU5LT96tx)

## Dashboard states

In our dashboard, you can notice the app embed states:

### **Connected**

Littledata's app embed is **enabled**; no action needed.

![](/files/W2UEOctBmrLIFXOVs5in)

***

### **Not detected**

We've detected that our app embed has been disabled from your store's theme; click "**Fix now**" and follow the setup to re-enable it.

![](/files/VMB65P0lFGe9QAzNvuuc)

## How to check if the app embed is loaded

Go to your store's source code and look for `littledata-revenue-tracking/blocks/LittledataLayer.` Our script should be displayed there; if not, make sure you've followed the installation steps precisely.

If you have the Segment app installed, in the store's source code, look for `segment/blocks/LittledataLayer`

![](/files/Afzm5ETW2No0ADTVMTVk)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/advanced/developer/littledata-app-embed-how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
