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

# Generate Track Url

> Documentation for the Generate Track Url action for Morf

![images/morf.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/morf.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=ae6978dd2d8b4d3a340944239283af5c)

The **Generate Track Url** action creates browser-friendly URLs that trigger Track events when accessed. This enables triggering Morf analytics events through simple HTTP GET requests, making it ideal for email links, embedded buttons, or any scenario where you need to track user interactions via URL clicks.

## How It Works

When a browser visits the generated URL:

1. **Browser Request**: A user clicks the generated URL or their browser navigates to it
2. **Track Event Processing**: Morf decodes the embedded track data and processes the analytics event
3. **Response**: The browser receives either:
   * A custom success page (if `Success Text` was provided)
   * A JSON response (if no `Success Text` was provided)

The generated URL contains encoded track event data that gets processed through Morf's standard Track API endpoint when accessed.

## Use Cases

* **Email Marketing**: Track email click-through events by embedding tracking URLs in email content
* **Social Media**: Monitor engagement from social media posts and campaigns
* **Web Analytics**: Track button clicks, form submissions, or other user interactions
* **Customer Journeys**: Capture touchpoints across different platforms and channels

# Parameters

**Action** `Parameters`

**parameters**

**Success Text** `string` *required*

Custom message to display on the success page when someone visits the generated URL. If provided, users will see a branded HTML page with this text after the track event is processed. If not provided, a JSON response will be returned instead.

**Event Name** `string` *required*

The name of the analytics event to trigger when the URL is accessed. This event will be processed through Morf's Track API.

**User ID** `string` *required*

`ID` The unique identifier for the user associated with this track event. This value will be stored as the active customer ID.

**Profile Properties** `Map\<string,dynamic (any)\>` *required*

`HI` `ID` `PII` Property values to store on the Morf Profile when the track event is processed. These properties will be permanently updated on the user's profile.

**Event Data** `Map\<string,dynamic (any)\>` *required*

`HI` `ID` `PII` Data associated with the event that will be available within Morf Workflows but is *not* automatically stored on the Morf Profile.

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "track_data": "A serialized morf_analytics.v1.Track protobuf message",
    "url": "https://api.morf.healthcare/v1/track/link/d2aae7a5-b3b0-4bee-991b-695d501c91e5?success_text=hello%20world&track_data=ChQKEmpvaW4tYnV0dG9uLWNsaWNrZWQSJGQyYWFlN2E1LWIzYjAtNGJlZS05OTFiLTY5NWQ1MDFjOTFlNRo%3D"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "track_data": {
      "event_data": "(Optional) Data associated with the event, *not* automatically stored on the Morf Profile",
      "event_id": "(Optional) Unique identifier for the event (e.g. a UUID)",
      "event_name": "(Required) Event name",
      "occurred_at": "(Optional) Time the event occurred, if not provided - the time Morf receives the track event (RFC3339 ISO Format)",
      "profile_ids": {
        "active_campaign": "(Optional) An Active Campaign Contact ID",
        "athena": "(Optional) An Athena Patient ID",
        "axle_health": "(Optional) An Axle Health Patient ID",
        "boulevard": "(Optional) A Boulevard Client ID",
        "butterfly_labs": "(Optional) A Butterfly Labs Patient ID",
        "customer": "(Optional) Any unique identifier in your organization",
        "customer_io": "(Optional) A Customer.io Customer ID",
        "elation": "(Optional) An Elation Patient ID",
        "feathery": "(Optional) A user ID for a Feathery flow",
        "formsort": "(Optional) A responder UUID for a Formsort flow",
        "freshdesk": "(Optional) A Freshdesk Contact ID",
        "healthie": "(Optional) A Healthie User (Patient) ID",
        "hubspot": "(Optional) A Hubspot Contact ID",
        "intakeq": "(Optional) An IntakeQ Patient ID",
        "intercom": "(Optional) An Intercom Contact ID",
        "junction": "(Optional) A Junction Patient ID",
        "medplum": "(Optional) A Medplum Patient ID",
        "nextech": "(Optional) A Nextech Patient ID",
        "open_phone": "(Optional) An OpenPhone Contact ID",
        "posthog": "(Optional) A PostHog Person ID",
        "recurly": "(Optional) A Recurly Subscriber ID",
        "sana_benefits": "(Optional) A Sana Benefits Patient ID",
        "segment": "(Optional) A Segment Anonymous- or User- ID",
        "spruce": "(Optional) A Spruce Contact ID",
        "stripe": "(Optional) A Stripe Customer ID",
        "zoho": "(Optional) A Zoho Contact ID"
      },
      "profile_properties": "(Optional) Property values to store on the Morf Profile",
      "source_id": null,
      "user_id": "(Required) Unique user ID. Note: this value will be stored as the active customer ID"
    },
    "url": "The url-encoded track event URL which when a browser request is made to will trigger the track event to fire in Morf"
  }
}
```

### Result Object Field Details

You can use the result of the action's data as inputs to downstream workflow actions.

Each fetch action requires a result object key to be specified which will nest the action's result data inside the downstream data context in the Workflow.

Here we demonstrate how to refer to this data using the prefix `$result_object_key`.

**GenerateTrackUrlResult** `Fetch Action Response Object`

**fields**

**url** `string` *required*

The url-encoded track event URL which when a browser request is made to will trigger the track event to fire in Morf

```json CEL theme={null}
$result_object_key.url
```

```json Example theme={null}
"https://api.morf.healthcare/v1/track/link/d2aae7a5-b3b0-4bee-991b-695d501c91e5?success_text=hello%20world&track_data=ChQKEmpvaW4tYnV0dG9uLWNsaWNrZWQSJGQyYWFlN2E1LWIzYjAtNGJlZS05OTFiLTY5NWQ1MDFjOTFlNRo%3D"
```

**track\_data** `object` *required*

The track event data that was encoded into the URL

```json CEL theme={null}
$result_object_key.track_data
```

```json Example theme={null}
"A serialized morf_analytics.v1.Track protobuf message"
```

**track\_data.event\_id** `string`

(Optional) Unique identifier for the event (e.g. a UUID)

```json CEL theme={null}
$result_object_key.track_data.event_id
```

```json Example theme={null}
"42b7133b-84db-436e-b721-7a63f2dde515"
```

**track\_data.event\_name** `string` *required*

(Required) Event name

```json CEL theme={null}
$result_object_key.track_data.event_name
```

```json Example theme={null}
"join-button-clicked"
```

**track\_data.user\_id** `string` *required*

`ID` (Required) Unique user ID. Note: this value will be stored as the active customer ID

```json CEL theme={null}
$result_object_key.track_data.user_id
```

```json Example theme={null}
"d2aae7a5-b3b0-4bee-991b-695d501c91e5"
```

**track\_data.profile\_ids** `object`

`ID` (Optional) Profile IDs. Third party IDs to associate with the Profile.

```json CEL theme={null}
$result_object_key.track_data.profile_ids
```

```json Example theme={null}
{
"active_campaign": "51071",
"athena": "12312",
"axle_health": "0f472e61-138b-4bbe-b222-a5d254e2cdcd",
"boulevard": "urn:blvd:Client:client123",
"butterfly_labs": "663dbc35-500b-47d3-9d42-4bc29a729a08",
"customer": "1ea83e74-1dd7-4569-b8d6-866a43680917",
"customer_io": "e2e9163e-2a48-4cd4-9c78-0f7477c55126",
"elation": "100121441215212",
"feathery": "a9560d4e-5e75-43c8-89f8-2245ec2bdfd4",
"formsort": "1ea83e74-1dd7-4569-b8d6-866a43680917",
"freshdesk": "410ad90d-805f-4be5-9942-5490259c3ed6",
"healthie": "43281",
"hubspot": "80478911765",
"intakeq": "8213",
"intercom": "6025231623163",
"junction": "51261b3f-de23-459e-9c82-ed97496e317e",
"medplum": "7daba5ae-708d-4d75-9d5a-4744cea5cdbe",
"nextech": "a9db751b-c154-4e75-8f9c-ae7dd89ddeec",
"open_phone": "67f8f19bccf2f4d79cd6357a",
"posthog": "a9560d4e-5e75-43c8-89f8-2245ec2bdfd4",
"recurly": "3658ba4c-085d-4995-9e36-25f0401007db",
"sana_benefits": "100031277",
"segment": "51261b3f-de23-459e-9c82-ed97496e317e",
"spruce": "entity_0E5QDGJC03000",
"stripe": "cus_RpeF9OcJYBinL6",
"zoho": "1234567890123456789"
}
```

**track\_data.profile\_ids.customer** `string`

(Optional) Any unique identifier in your organization

```json CEL theme={null}
$result_object_key.track_data.profile_ids.customer
```

```json Example theme={null}
"1ea83e74-1dd7-4569-b8d6-866a43680917"
```

**track\_data.profile\_ids.formsort** `string`

(Optional) A responder UUID for a Formsort flow

```json CEL theme={null}
$result_object_key.track_data.profile_ids.formsort
```

```json Example theme={null}
"1ea83e74-1dd7-4569-b8d6-866a43680917"
```

**track\_data.profile\_ids.healthie** `string`

(Optional) A Healthie User (Patient) ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.healthie
```

```json Example theme={null}
"43281"
```

**track\_data.profile\_ids.axle\_health** `string`

(Optional) An Axle Health Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.axle_health
```

```json Example theme={null}
"0f472e61-138b-4bbe-b222-a5d254e2cdcd"
```

**track\_data.profile\_ids.butterfly\_labs** `string`

(Optional) A Butterfly Labs Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.butterfly_labs
```

```json Example theme={null}
"663dbc35-500b-47d3-9d42-4bc29a729a08"
```

**track\_data.profile\_ids.recurly** `string`

(Optional) A Recurly Subscriber ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.recurly
```

```json Example theme={null}
"3658ba4c-085d-4995-9e36-25f0401007db"
```

**track\_data.profile\_ids.intercom** `string`

(Optional) An Intercom Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.intercom
```

```json Example theme={null}
"6025231623163"
```

**track\_data.profile\_ids.sana\_benefits** `string`

(Optional) A Sana Benefits Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.sana_benefits
```

```json Example theme={null}
"100031277"
```

**track\_data.profile\_ids.active\_campaign** `string`

(Optional) An Active Campaign Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.active_campaign
```

```json Example theme={null}
"51071"
```

**track\_data.profile\_ids.junction** `string`

(Optional) A Junction Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.junction
```

```json Example theme={null}
"51261b3f-de23-459e-9c82-ed97496e317e"
```

**track\_data.profile\_ids.segment** `string`

(Optional) A Segment Anonymous- or User- ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.segment
```

```json Example theme={null}
"51261b3f-de23-459e-9c82-ed97496e317e"
```

**track\_data.profile\_ids.intakeq** `string`

(Optional) An IntakeQ Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.intakeq
```

```json Example theme={null}
"8213"
```

**track\_data.profile\_ids.customer\_io** `string`

(Optional) A Customer.io Customer ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.customer_io
```

```json Example theme={null}
"e2e9163e-2a48-4cd4-9c78-0f7477c55126"
```

**track\_data.profile\_ids.freshdesk** `string`

(Optional) A Freshdesk Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.freshdesk
```

```json Example theme={null}
"410ad90d-805f-4be5-9942-5490259c3ed6"
```

**track\_data.profile\_ids.hubspot** `string`

(Optional) A Hubspot Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.hubspot
```

```json Example theme={null}
"80478911765"
```

**track\_data.profile\_ids.stripe** `string`

(Optional) A Stripe Customer ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.stripe
```

```json Example theme={null}
"cus_RpeF9OcJYBinL6"
```

**track\_data.profile\_ids.feathery** `string`

(Optional) A user ID for a Feathery flow

```json CEL theme={null}
$result_object_key.track_data.profile_ids.feathery
```

```json Example theme={null}
"a9560d4e-5e75-43c8-89f8-2245ec2bdfd4"
```

**track\_data.profile\_ids.open\_phone** `string`

(Optional) An OpenPhone Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.open_phone
```

```json Example theme={null}
"67f8f19bccf2f4d79cd6357a"
```

**track\_data.profile\_ids.elation** `string`

(Optional) An Elation Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.elation
```

```json Example theme={null}
"100121441215212"
```

**track\_data.profile\_ids.athena** `string`

(Optional) An Athena Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.athena
```

```json Example theme={null}
"12312"
```

**track\_data.profile\_ids.posthog** `string`

(Optional) A PostHog Person ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.posthog
```

```json Example theme={null}
"a9560d4e-5e75-43c8-89f8-2245ec2bdfd4"
```

**track\_data.profile\_ids.nextech** `string`

(Optional) A Nextech Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.nextech
```

```json Example theme={null}
"a9db751b-c154-4e75-8f9c-ae7dd89ddeec"
```

**track\_data.profile\_ids.medplum** `string`

(Optional) A Medplum Patient ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.medplum
```

```json Example theme={null}
"7daba5ae-708d-4d75-9d5a-4744cea5cdbe"
```

**track\_data.profile\_ids.spruce** `string`

(Optional) A Spruce Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.spruce
```

```json Example theme={null}
"entity_0E5QDGJC03000"
```

**track\_data.profile\_ids.zoho** `string`

(Optional) A Zoho Contact ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.zoho
```

```json Example theme={null}
"1234567890123456789"
```

**track\_data.profile\_ids.boulevard** `string`

(Optional) A Boulevard Client ID

```json CEL theme={null}
$result_object_key.track_data.profile_ids.boulevard
```

```json Example theme={null}
"urn:blvd:Client:client123"
```

**track\_data.profile\_properties** `object`

`HI` `PII` (Optional) Property values to store on the Morf Profile

```json CEL theme={null}
$result_object_key.track_data.profile_properties
```

```json Example theme={null}
{
"date_of_birth": "2000-01-01",
"email_address": "johndoe@example.com",
"phone_number": "+15551234122"
}
```

**track\_data.event\_data** `object`

`HI` `PII` (Optional) Data associated with the event, *not* automatically stored on the Morf Profile

```json CEL theme={null}
$result_object_key.track_data.event_data
```

```json Example theme={null}
{
"plan_purchased": "Comprehensive Wellness++",
"session_id": "13139112"
}
```

**track\_data.occurred\_at** `string`

(Optional) Time the event occurred, if not provided - the time Morf receives the track event (RFC3339 ISO Format)

```json CEL theme={null}
$result_object_key.track_data.occurred_at
```

```json Example theme={null}
"2025-01-02T03:04:05+06:00"
```

**track\_data.source\_id** `string` *required*

*Description coming soon*

```json CEL theme={null}
$result_object_key.track_data.source_id
```

```json Example theme={null}
null
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.