# Install on Bubble

Canonical: https://sourcetag.io/docs/install-bubble

Add SourceTag's tracking script to your Bubble app. You can do this at the page level or app-wide using Bubble's SEO/meta tags settings.

## Step 1: Copy your script tag

In your SourceTag dashboard, go to your site's detail page and copy the script tag. It looks like:

```html
<script src="https://cdn.sourcetag.io/scripts/YOUR_SITE_ID/st.js"></script>
```

## Step 2: Add to Bubble

### Option A: App-wide (recommended)

1. In the Bubble editor, go to **Settings** > **SEO / metatags**
2. Paste the script tag into the **Script/meta tags in header** field
3. This loads the script on every page of your app

### Option B: Using an HTML element

1. Drag an **HTML** element onto your page
2. Paste the script tag into the element's HTML content
3. Repeat this on every page where you want attribution tracking (though we recommend the app-wide approach above)

## Step 3: Deploy

Deploy your Bubble app to live. The tracking script is now active.

## Step 4: Test

Visit your live app with UTM parameters:

```text
https://yourapp.bubbleapps.io/?utm_source=test&utm_medium=cpc&utm_campaign=bubble-test
```

Submit a form on your app and check wherever your form submissions are received. The submission should include hidden fields with attribution data.

## Notes

- Bubble forms work differently to standard HTML forms. SourceTag detects form elements on the page via MutationObserver, which handles Bubble's dynamically rendered inputs.
- If SourceTag doesn't detect your form automatically, you can add hidden input fields manually and map them in the SourceTag dashboard. See [Add Hidden Fields to HTML Forms](https://sourcetag.io/docs/fields-html) for the field names.
- Browser cookies are limited to 7 days on Bubble (no server-side cookie option available for Bubble apps currently).
