# Easy Embed URL Testing

**URL:** <https://community.omni.co/t/easy-embed-url-testing/255>\
**Category:** Embedded Analytics\
**Created:** [March 4, 2025, 12:21am UTC](https://community.omni.co/t/easy-embed-url-testing/255 "2025-03-04T00:21:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![russ](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.omni.co/russ/32/296_2.png) [@russ](https://community.omni.co/u/russ)\
**Post date:** [March 4, 2025, 12:21am UTC](https://community.omni.co/t/easy-embed-url-testing/255/1 "2025-03-04T00:21:43Z")

</div>

When testing Embedded analytics with Omni, the URL builder is an amazing tool. But it doesn’t support all of the extended attributes you may want to pass to produce a test url.

This is an easy API recipe using our [Python SDK](https://github.com/exploreomni/omni-python-sdk).

You can see the script for generating a url [here](https://github.com/exploreomni/omni-python-sdk/blob/main/examples/generate_embed_url.py). But we’ll walk through the setup step by step.

First, install the python SDK. You may want to create a virtual environment first.

#### Optional Step 0 - Create a virtual environment

Starting in a folder you’d like the script to live in. [Double check you have at least python 3.9+](https://www.naukri.com/code360/library/how-to-check-python-version-in-cmd)

```bash
python -m venv ./.venv

```

Activate the virtual environment:

```bash
source ./.venv/bin/activate

```

[windows instructions](https://www.geeksforgeeks.org/creating-python-virtual-environment-windows-linux/)

#### Step 1 - Pip install the sdk

```bash
pip install omni_python_sdk

```

### Step 2 - Fill out the script

```python
from omni_python_sdk import OmniAPI

api = OmniAPI('<<your api key>>','https://<<your omni host>>')

response = api.generate_embed_url(
    {
    'contentPath': '/dashboards/example_metrics',
    'externalId': 'user@example.com',
    'name': 'Example (embed test user)',
    'secret': '<<your embed secret>>',
    'email':'user@example.com',
    'groups':'["my-example-group-name","second-group"]'
    }   
)
print(response.json()["url"])

```

- A full list of parameters can be found [here](https://docs.omni.co/docs/embed/external-embedding/setting-up-the-infrastructure)
- The embed secret is found under settings \> embed
- You’ll need to generate an API key
- Some parameters are URL encoded
- Some parameters such as groups (shown above) need to be a string of a list / array

### Step 3 - Run it!

You can take the url the script emits and paste it into an incognito browser for easy testing of attributes not covered by the URL Builder
