# Embed

At the core of any non-Shopify Zigpoll implementation is the embed code. Your embed code can be found in the "Installation" Tab.

<figure><img src="https://1643988190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZpanNFqg3aCUZgXh3X%2Fuploads%2FvpE1y7YouY7HCzUOYJyB%2Fimage.png?alt=media&#x26;token=2d598139-12b4-4f24-b635-47d1f8673bbd" alt=""><figcaption></figcaption></figure>

If you copy and paste that code into the **\<head>** tag of your website, you are all set.

The embed code looks something like this:

```javascript
<script type='application/javascript'>
  ;(function () {
    window.Zigpoll = {
      accountId: 'YOUR_ACCOUNT_ID'
    };

    var script = document.createElement("script");
    script.type = "text/javascript";
    script.charset = "utf-8";
    script.src = "//cdn.zigpoll.com/static/js/main.js";
    script.async = true;

    document.head.appendChild(script);
  }());
</script>
```

{% hint style="info" %}
**YOUR\_ACCOUNT\_ID** will be replaced the id for your particular account.
{% endhint %}

{% hint style="info" %}
[Contact us](mailto:support@zigpoll.com) if you need help installing the embed code. For paid plans we offer end to end installation support.
{% endhint %}

If you're on a site builder like Framer, Wix, or Webflow - see [Integrations](https://docs.zigpoll.com/integrations) for more detailed instructions on implementing Zigpoll into your platform.

#### Single Page Web Apps

If you have a single page webapp you can still use Zigpoll. All you need to do is run the following code immediately **after** you change a page within your app.

```
window.Zigpoll.refresh();
```

#### Load by Poll id

If you want to load a specific poll on a particular page, you can do so by adding a parameter called **pollId** to the Zigpoll object. For example:

```
<script type='application/javascript'>
  ;(function () {
    window.Zigpoll = {
      accountId: YOUR_ACCOUNT_ID,
      pollId: YOUR_POLL_ID
    };

    var script = document.createElement("script");
    script.type = "text/javascript";
    script.charset = "utf-8";
    script.src = '${src}';

    document.head.appendChild(script);
  }());
</script>
```

Will load the poll with id = **YOUR\_POLL\_ID.** This will override any display rules which are already set for the page.

## Inline Embedding

Zigpoll supports two methods for embedding a survey directly into your page content. Both render the survey inline rather than as a popup or slide-in widget.

### Copy & Paste Snippet

This is the simplest way to embed a survey. It is a single, self-contained code block that you paste wherever you want the survey to appear. No global embed script is required, and page rules are bypassed — the survey loads exactly where you place the snippet.

You can find this snippet in your survey's **Delivery Settings** under **Embed Settings → Copy & Paste Snippet**.

```html
<div id="zigpoll-embed-YOUR_POLL_ID"></div>
<script type="application/javascript">
  ;(function () {
    window.Zigpoll = {
      accountId: 'YOUR_ACCOUNT_ID',
      pollId: 'YOUR_POLL_ID'
    };
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.charset = "utf-8";
    script.src = "//cdn.zigpoll.com/static/js/main.js";
    script.async = true;
    document.head.appendChild(script);
  }());
</script>
```

{% hint style="info" %}
**YOUR\_ACCOUNT\_ID** and **YOUR\_POLL\_ID** will be pre-filled with the correct values when you copy the snippet from the dashboard.
{% endhint %}

### CSS Selector

This method uses the global embed script (installed in your `<head>` tag as described above) together with a container element on the page that matches a CSS selector you configure.

1. Make sure the **global embed code** is installed in your site's `<head>` tag.
2. Add a container element on the page where you want the survey to appear:

```html
<div id="zigpoll-embed-target"></div>
```

3. In your survey's **Delivery Settings**, set the **CSS Selector** to match the container (e.g. `#zigpoll-embed-target`).

With this method, page rules and display settings are still respected, giving you centralized control over when and where the survey appears.

### Which method should I use?

|                | Copy & Paste Snippet                                                          | CSS Selector                                                                      |
| -------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **Setup**      | Paste one code block — done                                                   | Install global script + add a container element + configure selector in dashboard |
| **Page rules** | Bypassed — survey always loads where the snippet is placed                    | Respected — survey follows your delivery settings                                 |
| **Best for**   | Landing pages, page builders, or placing multiple surveys on one page quickly | Sites where you want centralized control over display rules and visibility        |

### Multiple surveys on one page

Both methods support placing multiple surveys on a single page.

* **Copy & Paste Snippet**: Each snippet is fully independent. Paste as many snippets as you need — each one loads its own survey.
* **CSS Selector**: Use a unique selector for each survey (e.g. `#zigpoll-survey-1`, `#zigpoll-survey-2`) and configure each survey's delivery settings to point to its own container.
