Track URL activity in RCS messages
Rich communication services (RCS) messages often contain links to help end users go to the correct location or perform the required action. You can track these URLs to see how end users interact with your messages and identify their preferences and behavior.
You can then use this information to do the following:
- Personalization: Personalize future messages, making them more relevant.
- Performance analytics: Analyze the effectiveness of your campaigns.
This tutorial shows how to track URL clicks in RCS and generate reports. Customize the example to meet your use case and requirements.
Products and channels
Prerequisites
- Infobip account: If you do not have one, create a free trial account and select RCS as the channel on the welcome screen.
- Infobip API key with
rcs:message:send
scope: For information about creating an API key with the required scope, refer to API authorization. - HTTP client: This tutorial uses curl. Alternatively, you can choose the official Infobip SDK for the required programming language.
- RCS agent or sender: If you want to configure a custom RCS sender, please contact your Infobip account manager.
- Destination: A phone number to which RCS messages are sent. If the RCS agent is not launched, you can only send to safelisted phone numbers.
Implementation over the Infobip web interface
Create and launch a new broadcast
-
On the Infobip web interface (opens in a new tab), go to Moments > Broadcasts.
-
Select Create new broadcast.
-
Select RCS as the channel.
-
Choose the Recipients and select a Sender.
-
In the Content section, create a Text message that includes a URL.
Example: For news about CPaaS in Infobip, go to https://www.infobip.com/news/infobip-is-one-of-the-top-cpaas-providers-in-metrigys-cpaas-metrirank-report.
-
Select Tracking and reporting and do the following:
- Select Shorten URLs.
- (Optional) Remove https:// from the domain.
- Choose a domain - Default or Custom.
- Select Track URL clicks so that performance reports are available in Analyze.
-
Select Continue to preview.
-
Verify the content in the preview page.
-
Select Launch.
Get performance reports in Analyze
After you launch the campaign, you can get the Performance DLR from the Analyze section.
-
On the Infobip web interface, go to Analyze > Reports.
-
Select Create reports.
-
Select Performance.
-
In the Performance report content section, select Detailed clicks by URL and recipients.
-
Select the other metrics that you want for the report. Example: Date range and status.
-
Select View additional filters.
-
In the Communications field, select the name of the broadcast that you created.
-
Select Create report.
-
When the report is created, download it to see the results.
Implementation over API
-
Create an API request (opens in a new tab) to send RCS messages. In the API request, enable webhooks and tracking.
curlcurl -X POST https://api.infobip.com/rcs/2/messages \ -H 'Authorization: App {YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "messages": [ { "sender": "{YOUR_SENDER}", "destinations": [ { "to": "{YOUR_DESTINATION}" } ], "content": { "text": "Shorten URL and tracking test https://www.infobip.com/news/infobip-is-one-of-the-top-cpaas-providers-in-metrigys-cpaas-metrirank-report", "suggestions": [], "type": "TEXT" }, "webhooks": { "delivery": { "url": "YOUR_URL", "notify": true }, "callbackData": "URLtracking test", "seen": { "url": "YOUR_URL" } } } ], "options": { "tracking": { "shortenUrl": true, "trackClicks": true, "trackingUrl": "YOUR_URL" } } }
-
After a successful request (200 OK), you should receive the RCS message on the destination.
-
Select the link in the RCS message. Delivery reporting (DLR) is now included in the webhook URL.