# Installing the snippet

Our snippet is used to collect real user data. To get data in your RUMvision dashboards, each domain requires its own tracking snippet.

> Already installed the snippet and now want to make adjustments? Jump to our [introduction to Configure snippet](/help-center/monitoring/snippet/introduction/)

## Finding your snippet

Installing the snippet is straightforward.

1. Go to **domain** → **manage** → **snippet.**
2. Copy the snippet or share the public link with the person responsible for the snippet installation.
3. The easiest way is to install the snippet via Google Tag Manager (GTM).
4. After installing the snippet check your network requests and search for your own RUM code to check if everything is working and your website's Content Security Policy is not blocking the snippet.

![snippet-rumvision-install.png](/file/upload/img/snippet-rumvision-install.png?v=3d7d1a8336c7)

### Content Security Policy

To ensure RUMvision can reliably collect real user data, your Content Security Policy needs to allow a few specific sources.

These directives enable loading the RUM script and sending performance data to our ingestion endpoint.

```
      script-src d5yoctgpv4cpx.cloudfront.net  script-src 'unsafe-inline'  script-src 'unsafe-eval'  connect-src p2iqhncxyh.execute-api.eu-central-1.amazonaws.com  
```

#### What this means

- **cloudfront**  
   Allows the RUMvision script to be loaded from our CDN.
- **inline and eval**  
   `unsafe-eval` is only required for the inline pre-check that conditionally loads the RUM script using URL rules from `localStorage`.  
   If tracking is enabled on all pages, you can remove both this directive and the conditional logic from the snippet.
- **amazonaws**  
   Enables sending performance metrics to our API endpoint.

## GTM installation

The best strategy to embed your personal RUMvision snippet depends on your consent configuration. You could either embed the snippet depending on user consent, or without consent. There is an important difference though.

### Without consent

Embedding RUMvision without depending on user consent is very straight forward and does not lead to skewed data. Follow these steps to install our snippet via GTM:

1. Add a new tag.
2. Rename the tag to "RUMvision" or "Core Web Vitals monitoring" so that it's easy to recognize for others working in the same GTM container.
3. Click on "Tag Configuration", and choose "**Custom HTML**" within the side panel that will appear.
4. Paste your snippet in the HTML textbox that will appear.
5. Set the trigger to **all pages (type: Page View).**
6. Save the snippet and then click the submit button at the top right of the page.

[![Installing snippet via GTM](/file/upload/img/docs-installing-snippet-gtm.png?v=d138c3beba99)](/file/upload/img/docs-installing-snippet-gtm.png)

We have now started tracking the homepage you specified when you [registered your domain](/md/help-center/monitoring/getting-started/account-setup/). To track more you can set up pages.

> Did you add the snippet and now waiting for data? Learn more about [how soon you should see data](/md/help-center/monitoring/snippet/updates/).

### With consent

When you decide to load RUMvision only after user consent, you would still like to collect as much data as possible. When embedding your RUMvision snippet using the `Page View` event, RUMvision will only start to collect the next pageload after the pageload where users gave consent. In other words, you will end up missing a lot of valuable information.

For this explanation, we use the Google Consent Mode v2 principle. RUMvision tracking snippet falls within the `analytics_storage` category. For more information, see [Tag Manager consent mode support](https://support.google.com/tagmanager/answer/10718549/).

**Creating the GTM trigger**

You already should have created your own Custom Event for consent mode. This could either be `cookie_consent_update` (as seen in the screenshot below) or `consent_updated`. The exact value will be different per Consent Management Platform.

An example of a created **Custom Event** trigger can be found in the screenshot below.

[![docs-installing-snippet-gtm-consentmode-v2-trigger.png](/file/upload/img/docs-installing-snippet-gtm-consentmode-v2-trigger.png?v=efc20f270b3a)](/file/upload/img/docs-installing-snippet-gtm-consentmode-v2-trigger.png)

**Creating the GTM tag**

1. Add a new tag.
2. Rename the tag to "RUMvision" or "Core Web Vitals monitoring" so that it's easy to recognize for others working in the same GTM container.
3. Click on "Tag Configuration", and choose "**Custom HTML**" within the side panel that will appear.
4. Paste your snippet in the HTML textbox that will appear.
5. Collapse "**Advanced Settings**" and then collapse "**Consent Settings**".
6. Select radio button "**Require additional consent for tag to fire**" and click on the button " **+ Add required consent**".
7. In the form field that appears below, fill in or select "**analytics\_storage**".
8. Set the trigger to your custom consent event.
9. Save the snippet and then click the submit button at the top right of the page.

These steps are illustrated in the screenshot below.

[![docs-installing-snippet-gtm-consentmode-v2-tag.png](/file/upload/img/docs-installing-snippet-gtm-consentmode-v2-tag.png?v=a99c6e6d2b69)](/file/upload/img/docs-installing-snippet-gtm-consentmode-v2-tag.png)

## Without Google Tag Manager

You can choose to embed it either in the `head` or `body`

section of your HTML documents. Regardless of your choice, you'll always gather valuable RUM data. However, for the sake of data consistency, we recommend placing the script in the. Here are some performance best practices to consider when incorporating our inline JavaScript into your source code:

### In the head

When you decide to place it in the `head`, never position our JavaScript after a stylesheet. In other words, be sure to place the inline script just before your first stylesheet. Other scenarios will slow down FCP and potentially LCP.

### In the body

When placing our inline script in the `body`, it is best to position it at the end of the document instead of the start of the `body`.

## Direct setup for Magento 2

If you are running a Magento 2 , including Hyvä - storefront, you can easily implement our snippet using the community-built Elgentos RUMvision module.

This extension handles the snippet placement and automatically injects `page-type` meta tags into your HTML head to help RUMvision categorize your traffic out of the box. The default page types include: home, cms, product-detail, product-listing, cart, checkout, success, search, and account.

[https://github.com/elgentos/magento2-rumvision](https://github.com/elgentos/magento2-rumvision)

## Verify your installation

Once you have added the snippet to your source code, you will want to confirm it is actually firing. Open your website in a new browser tab, right-click anywhere on the page, and select Inspect to open the developer tools.

Navigate to the Network tab and refresh the page. Type "rum" in the filter box to search for your specific RUMvision code.

|| If you see the network request successfully firing with a 200 status code, your installation is complete. It usually takes just a few minutes for the first real user data to populate in your RUMvision dashboard.

## Check your Content Security Policy

If your website uses a Content Security Policy (CSP), the browser might block our inline script or the outgoing beacon by default. You will need to update your policy to allow the snippet to execute and send data back to our servers.

| Check your console in the developer tools. If CSP is blocking the snippet, you will see a red error message stating that the script violates your Content Security Policy directive.

To fix this, make sure to whitelist our endpoint domains in your `script-src` and `connect-src` directives.

## Next steps

Now that the snippet is actively collecting real user data, you can start categorizing your traffic. By default, we only track the specific homepage URL you provided when registering your domain.

To get a complete picture of your Core Web Vitals, you need to tell RUMvision which other page types to track. Head over to your dashboard to set up templates for your product pages, category pages, and articles.

Last changed 18 August 2026
