---
schema_version: "1"
id: f11c36482f8786adfb6494c18a828ba0b65c1631eef9876e406a72f0470e1089
title: Link Tracking
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_moc_link_tracking.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_moc_link_tracking.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e85b1cddaefb52e45fe7fe56e3c857077367284b16f715d17c8518f73e21521c
description: In MobileConnect, use link tracking to measure your SMS campaigns that contain URLs. Use one of these shorteners to track links.
products:
  - Marketing
  - Marketing Cloud Engagement
release: "264"
---
# Link Tracking

In MobileConnect, use link tracking to measure your SMS campaigns that contain URLs. Use one of these shorteners to track links.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_mobile_studio-264-0-0-production-enus/26e7f9fa-f44c-489b-9b21-135d26904a29/images/icon_note.png)

Note Some Android messaging apps automatically generate a link preview by visiting the URL included in an SMS message, which can result in an inflated click rate for SMS campaigns.

**Marketing Cloud Engagement**: Use the Engagement shortener in MobileConnect to measure the user engagement and campaign effectiveness. Track the total clicks for all subscribers and unique clicks per subscriber. Unique clicks are calculated based on verified clicks metric that filters out user agents, such as device previews, and data centers like AWS and Google Cloud. View the aggregated tracking information on the Message Details page, Journey Builder Analytics page, and Journey Builder SMS Analytics page. For more information, see [SMS Link Clicks Report](https://help.salesforce.com/s/articleView?id=mktg.mc_re_sms_link_clicks_report.htm&type=5&language=en_US).

Link shortening is automatically enabled on Hyperforce stacks. You don't need to turn on this feature in MobileConnect Setup.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_mobile_studio-264-0-0-production-enus/26e7f9fa-f44c-489b-9b21-135d26904a29/images/icon_important.png)

Important If the Engagement shortener isn’t enabled, contact your admin. In certain markets, there can be limitations for using shortened URLs for SMS. To verify if shortened links are permitted, contact your Account Manager.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_mobile_studio-264-0-0-production-enus/26e7f9fa-f44c-489b-9b21-135d26904a29/images/icon_note.png)

Note This shortener uses AWS to shorten links in messages.

**Bitly**: When you use Bitly, MobileConnect tracks the total clicks and click percentage, which is the total number of clicks divided by the total number of delivered messages. The Message Details page lists the total clicks compiled within 90 days after sending the message. To track the performance of different messages with the same link, create a different personalized link in Bitly for each message. MobileConnect doesn’t track branded Bitly links.

To track a link, you can add or modify it only during message creation or before sending the message. When editing a recurring message, you can’t change the link that is tracked. To change the link for responder templates, edit the message before it’s activated.

MobileConnect tracks all the shortened links that it finds in these message fields:

- Outbound - Outbound Message
- Text Response - Response Message
- Vote/Survey - Response Message
- Mobile Opt-in - Confirmation Message
- Info Capture - Confirmation Message
- Send Email - Response Message
- Email Opt-in - Confirmation Message
- Outbound Media - Outbound Message
- Media Response - Response Message
- Media Share - Response Message
- Keyword Opt-out - Response Message

## Dynamic Links

Marketing Cloud Engagement shortener supports dynamic links by using personalization strings or AMPscript which use values from an attribute, data extension field, or a variable. Use the correct AMPscript for dynamic links to avoid incorrect link shortening and subscriber errors.

Here are some guidelines with examples:

- Use dynamic query parameters in your URLs when sending an SMS to a Data Extension with `Name` and `SubscriberKey` columns. If the link only contains dynamic query parameters, you can create it by using inline AMPscript to ensure trackability. However, if you need a dynamic hostname and path in the URL, use the `RedirectTo()` function.
    
    ```html
    Hi %%=AttributeValue('Name')=%%,
    Here is your current balance: http://www.examplestore.com/balance?user=%%=AttributeValue('SubscriberKey')=%%&source=sms
    ```
- URLs containing dynamic query parameters must not include AMPscript in the protocol or hostname sections, but only in the query parameter section.
    
    ```html
    Click here - http://www.example.com/balance?user=%%=AttributeValue('SubscriberKey')=%%&source=sms
    ```
    
    ```html
    Click here - https://www.example.com/balance?amount=%%=v(@balance)=%%
    ```
- When a Data Extension includes the `IndividualUrl` column with each subscriber link, wrap the URL in `RedirectTo()` to track and shorten them.
    
    ```html
    Click here - %%=RedirectTo(AttributeValue('IndividualUrl'))=%%
    ```
- Create a URL in AMPscript block.
    
    ```html
    %%[
    SET @url = Concat("https://", "www.example.com/" ,"?param1=value")
    ]%%
    
    Click here - %%=RedirectTo(@url)=%%
    ```
    
    The `CloudPagesURL()` function only works for mobile contacts who are included in the email channel's **All Subscribers** list.
- SMS sent to a Data Extension with columns `Hostname` and `Path` corresponds to the hostname and path of the link. For example, you can dynamically generate URLs in AMPscript and track them.
    
    ```html
    %%[
        VAR @url, @host, @path
        SET @host = AttributeValue('Hostname')
        SET @path = AttributeValue('Path')
        
        SET @url = Concat("https:// ", @host, "/", @path, "?", "param1=value")
        /* Eg generated URL - https://hostname1/path1?param1=value */
    
    ]%%
    
    Click here : %%=RedirectTo(@url)=%%
    ```
- Link shortening is disabled when you use `ContentBlockById()`, `ContentBlockByKey()`, or `ContentBlockByName()` content functions.

## Link Expiration

Shortened links expire in 90 days and after the links expire, subscribers receive a page not found error.

#### See Also

- [Shorten URLs in SMS Message](https://help.salesforce.com/s/articleView?id=mktg.mc_moc_shorten_sms_links.htm&release=264.0.0&type=5 "In MobileConnect and Journey Builder, shorten single and multiple links to reduce the size of an SMS message. You can use either Bitly or the Marketing Cloud Engagement link shortener. Bitly tracks the total clicks for all subscribers. The Engagement shortener tracks the total clicks and unique clicks per subscriber.")