# iPaper Embed Script (Pop-ups)

{% hint style="info" %}
The iPaper embed script snippet is a small piece of JavaScript that you paste in to your webpages. It enables the iPaper service to inject Pop-ups into the pages where the embed script is present.
{% endhint %}

## Find your account specific embed script

1. Log in to your iPaper account.
2. Navigate to → ‘Pop-ups’.
3. Click the ‘Get embed script’ button.
4. Click ‘Copy script’ to copy the embed script to the clipboard.

<figure><img src="https://3504352165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW0UCgeNLp5UrqOZTjvsN%2Fuploads%2FQ5xuVLB82SZsOw5QsHLW%2Fipaper-embed-script.PNG?alt=media&#x26;token=aab7b35a-db9c-43ec-8f64-d283004781ee" alt=""><figcaption><p>The embed script modal</p></figcaption></figure>

## Insert snippet on your website

The embed script should be inserted as the last element of the `<body>` tag on every webpage where you want Pop-ups to show. A typical use case would be to add the embed script to all pages on your website.

{% hint style="info" %}
**Note:**

Browser loads webpages progressively, which means that the resources are loaded in order of their occurrence in the source code. It is a good practice to place nonessential scripts as the last elements of the webpage
{% endhint %}

<figure><img src="https://3504352165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW0UCgeNLp5UrqOZTjvsN%2Fuploads%2F4AkGrjQn7lQB84Elarft%2Fipaper-embed-script-2.PNG?alt=media&#x26;token=0ef79b14-a405-4723-a39d-cb030e564719" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:**

You don’t need the embed script when adding Pop-ups to your Flipbooks
{% endhint %}

## After you have added the embed script

Once the embed script is added to your website, you will start to see Pop-ups that match the URL you have defined.

## Final notes on embed script

### Same embed script for different Pop-ups under one license

Embed script are unique per license (login group). This means that all Pop-ups created under the same license will share the same embed script code. Therefore, there is no need to insert embed script with given API\_KEY on one webpage (URL) more than once, even when there is more than one lead generation tool that should be displayed on that page.

{% hint style="info" %}
**Note:**

You don’t need the embed script when adding Pop-ups to your Flipbooks
{% endhint %}

### Multiple embed scripts on same webpage

In some edge case scenarios there might be a reason to use different embed scripts (with unique API\_KEY) on the same webpage. This might be the case when users from different login groups are maintaining lead generation tools for the same webpage. In such cases the rules of inserting the code into webpage stays the same: embed scripts should always be inserted as the last elements of the `<body>` tag.


---

# 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://docs.ipaper.io/flipbook-integration/ipaper-embed-script.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.
