SMS
Shorten a long URL and track clicks in SMS
2 min
you can use exotel's sms api to shorten a long url in sms and you can track customer's click data as well shortening a long url will also reduce the number of characters in sms and allow you to stick to the 160 characters limit for sms follow steps below to set it up 1\ get in touch with your account manager or drop an email to "hello\@exotel com" to enable url shortening services for your account 2\ while making the api request to send sms, make below changes to your sms request set parameter "shortenurl" 'true' if you want to shorten a url, to provide flexibility, we allow you to set it to 'false' as well don't want to shorten any particular sms set parameter "shortenurlparams\[customdomain] " with the custom domain you want the short url to start with if custom domain is not present or empty, we will use the default domain(exo tl), if custom domain is given in the request it will be used to form the short url note clients will have to route the traffic on their custom domain to exo tl domain, this is a change on your domain management system set parameter "shortenurlparams\[tracking] " 'true' if you want to track data when a customer clicks on the url this feature is currently available to select customers in parameter "shortenurlparams\[clicktrackingcallbackurl]” enter a valid url to receive click tracking data you can also use sample requests available on our developer portal to use the feature and use the sample collection from postman 3 below would be the api response , sms will be delivered with a short url eg https //exo tl/vhdpzv the short url has a validity of 1 month 4\ whenever someone clicks on the shortened url, the following data would appear in the url provided in "shortenurlparams\[clicktrackingcallbackurl] sid the sid (unique id) of the shortened url short url the complete shortened url short code key of the shortened url long url original url which is shortened tracking whether the url is being tracked or not custom field custom field passed in sms api request expires at date time in iso format when link will expire created time date time in iso format when url is created last viewed date time in iso format when link was visited last total clicks count of total views of short url account sid exotel’s unique account sid country code country code of the customer who received the sms date created date time in iso format when link was created sms sid the sid (unique id) of the sms, this sid can be used to track the sms to contact number of the customer who clicked on the url city city where the shorten url is clicked country country code where shorten url is clicked ip ip address where shorten url is clicked postal code postal code where shorten url is clicked region region where shorten url is clicked accuracy radius aproximate accuracy radius where shorten url is clicked os version os version of the customer who clicked the shorten url os name os name of the customer who clicked the shorten url device name device name of the customer who clicked the shorten url platform type platform where shorten url is clicked
🤔
Have a question?
Our knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.