> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getjurni.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Scripts: Adding Third-Party Tracking Pixels

> Add custom scripts and third-party tracking pixels to your Jurni pages. Follow best practices for placement, loading order, and security when embedding external code.

Custom Scripts let you add a provider's browser script to Jurni-hosted pages when there is no suitable native integration. Ask the person responsible for your tracking or integration to supply and verify the code.

The important part of Custom Scripts is not only the code itself—it is **where the script is allowed to run**.

## Where to configure Custom Scripts

Open **Settings → Custom Scripts**.

Each script has:

* a **Name**
* the **Script** code
* a **Tracking** toggle
* **Funnel targeting**

## Funnel targeting

Jurni currently supports three targeting modes:

| Targeting mode    | Behavior                                                                              |
| ----------------- | ------------------------------------------------------------------------------------- |
| **All funnels**   | The script is eligible to run on every Jurni funnel in the shop.                      |
| **Only selected** | The script only runs on the funnels you select. At least one funnel must be selected. |
| **All except**    | The script runs on every funnel except the funnels you select.                        |

Use **Only selected** for campaign-specific vendors or scripts that should be introduced gradually. Use **All except** when a script is broadly required but a small set of funnels need a different implementation.

## Tracking scripts and Preview

When **Tracking** is enabled, Jurni intentionally hides the script in Preview mode. Tracking scripts run on the **live funnel**, not inside the editor preview.

<Info>
  If a tracking vendor does not appear while you are previewing a draft, publish the funnel and test the live URL before treating it as a loading issue.
</Info>

This helps prevent preview/editor activity from contaminating production analytics.

## Add a custom script

<Steps>
  <Step title="Open Custom Scripts">
    In Jurni, go to **Settings → Custom Scripts** and choose **New Script**.
  </Step>

  <Step title="Name the script">
    Use a recognizable vendor or purpose name such as `MNTN Pixel`, `RudderStack`, or `Quiz Tracking`.
  </Step>

  <Step title="Paste the browser-side code">
    Paste the vendor snippet or implementation provided by your analytics team.
  </Step>

  <Step title="Choose whether it is a tracking script">
    Keep **Tracking** enabled for analytics/pixel code that should only execute on live funnels.
  </Step>

  <Step title="Set funnel targeting">
    Choose **All funnels**, **Only selected**, or **All except** and select funnels when required.
  </Step>

  <Step title="Save, publish, and verify">
    Test the live funnel and confirm the script loads exactly where expected.
  </Step>
</Steps>

## Shopify Pages behave differently

A funnel published as a native **Shopify Page** runs inside the Shopify storefront/theme environment. Jurni's Shopify Pages implementation loads Jurni attribution/tracking for the funnel, but it does **not automatically reproduce every Jurni Custom Script or vendor integration that runs on a Jurni-hosted storefront funnel**.

This matters for script-based tools such as overlays, review drawers, pixels, or other widgets.

<Warning>
  Do not assume a script working on a Jurni subdomain will automatically run the same way after the funnel is published as a Shopify Page. Test the Shopify Page separately and use the Shopify theme/app installation path when that vendor needs to run natively on Shopify.
</Warning>

The reverse is also important: Shopify Pages can inherit scripts already installed by the Shopify theme, GTM, or apps. Avoid creating a second installation path that causes duplicate events.

## Common duplicate-tracking pattern

Before adding a pixel through Custom Scripts, check whether it is already loaded by:

1. a native Jurni integration
2. Jurni Custom Scripts
3. Google Tag Manager
4. the Shopify theme
5. a Shopify app or other third-party loader

A page should have one intentional installation path for each tag unless the vendor explicitly requires otherwise.

## Performance and security

Custom JavaScript executes in the shopper's browser. Before rolling it out broadly:

* test one live funnel first
* keep the targeting scope as narrow as practical
* remove obsolete scripts
* use the vendor's asynchronous loader when provided
* do not place private API secrets or server-side credentials in browser code
* verify that consent rules are respected for advertising/analytics scripts

## Related guides

* [Google Tag Manager](/integrations/gtm)
* [Google Analytics & Meta Pixel](/integrations/ga-meta-pixel)
* [Consent & Tracking](/integrations/consent-tracking)
* [Shopify Pages: Setup & Publish](/shopify-pages/setup-publish)
* [Duplicate Tracking Events](/troubleshooting/duplicate-tracking-events)


## Related topics

- [Consent and Tracking on Jurni Pages](/integrations/consent-tracking.md)
- [Duplicate Tracking Events or Pixels](/troubleshooting/duplicate-tracking-events.md)
- [Connect Polar Analytics](/integrations/polar-analytics.md)
- [Connect Meta Pixel](/integrations/meta-pixel.md)
- [Connect Northbeam page tracking](/integrations/northbeam.md)
