There is a significant improvement that SCG brings to the table, about URL tracking. Its’s about multiple URL tracking and new processing of the tracking status for this feature. This new ability to track multiple URL immediately leads to the need to identify every link and consequently the requirement to name the links to track.
This document provides information on how to use the new #trackingUrl functionality and describes the processing dissimilarities from the single URL tracking functionality.
Single URL tracking
This functionality is described in the article: Using Link Tracking Service in Messages – Syniverse Developer Community
Named URL tracking
The new tracking function allows to track multiple URL sent in the same message body. To be able to identify the tracking information for each tracking URL, SCG require a label for each tracking keyword.
The tracking keyword looks like: #trackurl("url","trackLabel")
As the name suggest, this feature allows to name the URLs to be tracked, indeed allowing to track multiple URL sent in the same message.
Tracking information
Once the tracking keyword is properly included in the message body and the message is sent, the message Delivered Receipts will include the needed information to track each URL. When the consumer get the message and tap a URL, a new DR will be sent with the “CLICKTHRU” status and including the trackLabel to effectively identify the URL.
Webhook post
A DR will be post to the webhook for every tap to any of the message links. This is a significative difference to the previous version as now, multiple clickthru DR are allowed. There will be one DR for each tap the URL links receive in the mobile message.
DR examples
In this example, you will find below the DR for the message that includes two URLs with the tracking keyword for:
- https://www.syniverse.com/ labeled as toSynPortal
- https://sdcsupport.syniverse.com/ labeled as toDevPortal
The cURL to send the message:
curl -L POST 'https://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {TOKEN}' \
-d '{
"from":"channel:Bxn9SHBYhl89KnuDllO2L4",
"to":"+5066173XXXX",
"body": "This is a SMS test message with tracking URL to Syniverse homepage #trackurl(\"https://www.syniverse.com/\",\"toSynPortal\") or Syniverse support site #trackurl(\"https://sdcsupport.syniverse.com/\",\"toDevPortal\")"
}'
When recipient click a url to navigate to the link (let’s say the first one), a DR will be posted to the webhook as:
{
"topic": "SCG-Message",
"attempt": 1,
"event": {
"fld-val-list": {
"previous_state": "DELIVERED",
"message_request_id": "RNHVs3dH0XmPaAEUoAMSY6",
"message_id": "RNHVs3dH0XmPaAEUoAMSY6",
"to_address": "+5066173XXXX",
"has_attachment": false,
"reason_description": "SUCCESS",
"application_id": XXXXX,
"reason_code": "200",
"sender_id_alias": "FVwXNFWghnXyBazsXXXXXX",
"company-id": XXXXXX,
"sender_id_id": "FVwXNFWghnXyBazsXXXXXX",
"external_message_request_id": "",
"new_state": "CLICKTHRU",
"fragments_count": 1,
"from_address": "7777",
"mt_price": 0,
"track_name": "toSynPortal"
},
"evt-tp": "message_state_change",
"timestamp": "2024-06-04T22:22:17.343Z"
},
"event-id": "YXt9cHbqTh__wSedlwv_8Q"
}
The same way, when the recipient clicks the second url link, a DR will be posted to the webhook as:
{
"topic": "SCG-Message",
"attempt": 1,
"event": {
"fld-val-list": {
"previous_state": "CLICKTHRU",
"message_request_id": "RNHVs3dH0XmPaAEUoAMSY6",
"message_id": "RNHVs3dH0XmPaAEUoAMSY6",
"to_address": "+5066173XXXX",
"has_attachment": false,
"reason_description": "SUCCESS",
"application_id": XXXXXX,
"reason_code": "200",
"sender_id_alias": "FVwXNFWghnXyBazsXXXXXX ",
"company-id": XXXXXX,
"sender_id_id": "FVwXNFWghnXyBazsXXXXXX ",
"external_message_request_id": "",
"new_state": "CLICKTHRU",
"fragments_count": 1,
"from_address": "7777",
"mt_price": 0,
"track_name": "toDevPortal"
},
"evt-tp": "message_state_change",
"timestamp": "2024-06-04T22:33:30.567Z"
},
"event-id": "JYmRWg5SSaiYI9pVarVMKQ"
}
0 Comments