Source: https://mindstamp.com/help/pass-url-parameters-into-an-embed
Generated from the Help Center records: 2026-10-05

# How do I pass URL parameters from my page into an embedded video?

Topic: [API, MCP and AI agents](https://mindstamp.com/help/api-ai) · Updated: 2026-09-25

## Short answer

Add a short script to the page that copies the page's query string onto the Mindstamp iframe address. The player then reads each parameter. name, email, phone and custom_id identify the viewer, and every other parameter becomes a variable you can show in the video and see in reports.

## Steps

1. Embed the video with the embed code from the video's **Share** page.
2. Add the script below to the page, after the embed code.
3. If you use a custom domain for your videos, add it to the playerHosts list.
4. Open the page with test parameters, for example ?name=Sam%20Lee&custom_id=E-1024&utm_source=newsletter.
5. Play the video, then open **Reporting** > **Views**. The view shows Sam Lee with custom ID E-1024.

## The script

The script adds each page parameter to the Mindstamp iframe address. It does not replace a parameter that the embed code already sets, and it leaves other iframes alone.

```
const playerHosts = ['embed.mindstamp.com', 'interact.video'];

const passPageParams = () => {
  const pageParams = new URLSearchParams(window.location.search);
  if (!pageParams.toString()) return;

  document.querySelectorAll('iframe[src]').forEach((frame) => {
    const src = new URL(frame.src);
    if (!playerHosts.includes(src.hostname)) return;

    pageParams.forEach((value, key) => {
      if (!src.searchParams.has(key)) src.searchParams.set(key, value);
    });
    frame.src = src.toString();
  });
};

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', passPageParams);
} else {
  passPageParams();
}
```

## Parameters the player understands

- name, email, phone and custom_id set the viewer's identity. Reports and exports show them.
- Any other parameter becomes a variable with the same name, for example utm_source or company. You can show variables in the video with personalization, and exports can include them.
- t, autoplay, loop and fullscreen control playback. The embed code sets these from your video settings.
- lang selects the viewer language for a translated video.

## Things to know

- URL-encode values. A space is %20 and @ is %40. URLSearchParams in the script encodes values for you.
- Changing the iframe address reloads the player. The script runs once when the page loads, so it does this only once.
- If you only need to identify viewers from a link you send, you do not need a script. Add the parameters to the share link, or use a personalized link.
- Showing variables in the video (personalization) is on Core and higher plans. See [pricing](https://mindstamp.com/pricing).
- Do not put private data in a URL that other people can see or share.

## Go further

- [Variables tutorial](https://mindstamp.com/tutorials/variables)
- [Personalization](https://mindstamp.com/features/personalization)
- [Compare plans](https://mindstamp.com/pricing)

## Related answers

- [How can I embed a Mindstamp video on my website?](https://mindstamp.com/help/how-can-i-include-a-video-embed-on-my-website)
- [How do I personalize a video with variables?](https://mindstamp.com/help/how-do-i-use-personalization-and-dynamic-variables-on-mindstamp)
- [How do I personalize video links from my CRM or website?](https://mindstamp.com/help/personalize-video-links-from-crm)
- [Why aren’t my personalization variables being replaced?](https://mindstamp.com/help/personalization-variables-arent-replacing-in-my-video-why)

---

Need more help? [Contact Mindstamp](https://mindstamp.com/contact) · [Help Center](https://mindstamp.com/help) · [All Help Center articles as JSON](https://mindstamp.com/help-feed/index.json)
