# Put your story on your website

Source: https://knowledge.intractive.app/en/articles/implement-your-story-on-your-website

You can show your story on your own website. It can open as a pop-up when a visitor clicks something on your page, or play inline in an area of the page with an iframe you add yourself.

## Choose pop-up or inline

The **Website** option in **Share** creates pop-ups. A story can also play inline, with an iframe you add yourself. The two presentation modes:

- **Pop-up**: the story opens full screen, on every device, on top of your page when a visitor clicks a button or a link.
- **Inline**: the story plays directly inside an area of the page you choose, in an iframe.

### Pros and cons of the pop-up

Pros:

- Little to set up: add the script and link your story.
- Takes up no space on your page until a visitor clicks.

Cons:

- You need to add a script to your site, and some website builders or security policies may not allow that.

## Get the embed code

Copy the embed code from your own story, not from this article.

1. Open your story in the editor.
2. Click **Share** in the top bar of your story.
3. Choose **Website** and click **Continue**.

   ![](https://storage.googleapis.com/intractive-knowledge-media/78aafdb46d9876d7bb3e2ec57d034f20e80ce22de5b2d7909e13742430bb5a60.gif)
4. Enter a **Placement name**, for example the page where you'll place the story. This name shows up in **Top traffic sources** in your story analytics.\
   \[screenshot: the Website editor with the Placement name field filled in\]
5. Optional: set **Language**, **Always restart**, **Set variables** or **Valid from (optional)** and **Valid until (optional)**. Every share entry has the other fields. The two date fields only show when your project's **Only through your links & QR codes** setting is on. We switch it on for you: send us a message in the chat.
6. Select **Create**. The editor shows the pop-up with a live example.\
   \[screenshot: the Website editor after Create, with Include the script and Add the link\]
7. Copy the snippet.

   ![](https://storage.googleapis.com/intractive-knowledge-media/42b826f5d9013a39368715bf44c220cec82b48c2540388c3f2dc5da9122039c3.png)

## Add the pop-up to your website

1. Paste the script you copied right before the closing `</body>` tag on your website, if you haven't already done so. The script doesn't contain the link to your story. You add the link in the next steps.
2. Find the link to your story. In the editor it's step 2, **Add the link**. Each share entry has its own link, and its code is the last part of that link.

   ![](https://storage.googleapis.com/intractive-knowledge-media/e72cb4e1ea1e0fe1158d7b2b4fc80e3bc361bb56cb4e0373c2751caf51a58694.png)
3. Add this link to your page, with `YOUR-CODE` replaced by the code from your link:

   ```html
   <a href="https://web.intractive.app/YOUR-CODE?embed=1">Open experience</a>
   ```

   If your project has a custom domain or subdomain, the editor gives the link on that domain. Older links on `links.intractive.app` still work and redirect to the web address.
4. Place the link behind the text, image or button that should open the story.

   ![](https://storage.googleapis.com/intractive-knowledge-media/1dbd5e199d01d9fd1ffc8e128c01ac6b9dbe36858f6e80826e5bd94efc973319.png)

When a visitor clicks the link, the story opens as a pop-up over your page.

![](https://storage.googleapis.com/intractive-knowledge-media/de3d5a8a32559730b85143b768ff74befd730eed044d2970bf1f133fea2bd56b.gif)

## Show the story inline

To show the story inside an area of your page, add an iframe yourself. This is a job for your web developer: Intractive doesn't generate this code.

1. Create a **Website** share entry, so visits are counted under its name in **Top traffic sources**.
2. Take its link and add `?embed=1` to the end.
3. Add an iframe to your page, in the area where the story should play, with that link as its source. Give it these permissions and no border:

   ```html
   <div style="position: relative; width: 100%; max-width: 480px; aspect-ratio: 9 / 16;">
     <iframe
       src="https://web.intractive.app/YOUR-CODE?embed=1"
       style="position: absolute; inset: 0; width: 100%; height: 100%; border: none;"
       allow="autoplay; camera; clipboard-write; geolocation; microphone; magnetometer; gyroscope; accelerometer; xr-spatial-tracking"
       allowfullscreen
       loading="lazy"
       referrerpolicy="strict-origin-when-cross-origin"
     ></iframe>
   </div>
   ```

\[screenshot: a web page with a story playing inline in one section of the page\]

The story plays in that area of the page.

Without the `allow` permissions, content blocks that need autoplay, the camera, the microphone, the visitor's location or the motion sensors don't work inside the frame. This affects AR, VR, 360° and location blocks. The story fills whatever space the iframe gets, so a portrait container suits it best. On small screens, give it the full width. Use the link exactly as the share entry shows it, including your custom domain or subdomain if you have one.

Inline entries created earlier still show the script and a `<div data-intractive-embed="YOUR-CODE">` element. They need the script on your page.

## For whoever builds your website

Send the snippet from the **Website** editor to whoever builds your website.

If the story runs inside an iframe on your page, as an inline embed does, Intractive sends the same events it pushes to `window.dataLayer` to your page with `window.postMessage`, as messages of the type `intractive.dataLayer`. They only arrive when your page sends a referrer. The default referrer policy, `strict-origin-when-cross-origin`, is enough; `no-referrer` blocks them.

A story sets no cookies. It keeps session and progress in local storage, or in session storage when tracking is set to Strict. The one cookie, `qr-<project>`, is set only when the project opens only through its own links and QR codes.

If your project moves to a custom domain, embeds already on your website keep working. Embed codes you copy after the switch use the new domain. To show the new domain on your site, copy the embed again from **Share** and replace the old snippet.

## Next

Test which placement works best, for example a button against a text link. Each share entry is tracked on its own, so create one **Website** entry per placement and give each a clear **Placement name**. You can then compare them in **Top traffic sources**.
