Call us now on 01772217772

Links: Advanced Link Techniques

Tagged with links, API, tracking, advanced
by Admin
in Documentation

06-Nov-2014 00:00


The links in TextGoto can be as simple or as powerful as you want them to be. Even if our system doesn't do exactly what you want, with a little bit of API integration you can build your own systems to take advantage of our links in your own code to achieve countless possibilities. For example, you might send out an SMS message containing voucher codes, and then check and apply that code on your own website... no problem! We'll even track the usage and validity of the voucher code for you.

Perhaps you want more control? That's fine - just forward the link to an address on your own site and simple querystring parameters can include the tracking code and phone number for you. From there you can track clicks and numbers yourself. Depending on how you set up your approach to link tracking you can open up extensive options.

Forwarding To Your Own API

In this case, you'll want to set up a Web Link, pointing at your own page to catch the forward. You can then include the Tracking ID and its associated phone number in the querystring by entering the link as follows...[TRACKINGID]&phone=[PHONE]

When somebody clicks on the tracking link you generate and send via 123, the call is made to your page and you can respond however you wish to that click.

Reading A Voucher/Tracking ID With The XML API

You might choose to send a customer a non-scanning voucher code, which can then be entered into your website. At that point, you can check the validity of the voucher code with the XML API. You check a voucher by making the following call to the XML API (the introductory article includes code samples and explains the structure):

<campaign> <header uid='[USERID]' pwd='[PASSWORD]' action='CHECK_LINK'/> <body> <id>[VOUCHER CODE ID]</id> <readonly>false</readonly> </body> </campaign>

Depending on the type of code, the CHECK_LINK function will return different data. In the case of an eVoucher, it will return the following data:

<?xml version="1.0" encoding="utf-8"?> <output> <type>eVoucher</type> <name>The voucher's name</name> <shorturl>The short URL associated with the link</shorturl> <id>The link code</id> <phone>The phone number this code was sent to</phone> <scans>The number of times the code has been scanned</scans> <expiry>The expiry date and time of the voucher, formatted dd/mm/yyyy HH:MM:ss</expiry> <uses>The number of uses permitted for the voucher, 0 indicates infinite uses</uses> <description>The description of the voucher that the user sees</description> <instruction>The instruction returned when scanned/checked</instruction> <status>Any special status information, possible values are OK, NO_MORE_USES and EXPIRED</status> </output>

Normally, reading a voucher code via the XML API will act as if the voucher has been scanned, and will increment the scans value accordingly. However, this behaviour can be turned off by including a READONLY value of "true" in the XML call.

Sending Links To Specific Numbers Via The XML API

Say you want to implement an eTicket using scannable vouchers for an event - you want to control only sending tickets to people who have paid for them. No problem, you simply handle the payments yourself and then send the voucher using the XML API. How does that work? Simple.

When you have a phone number you want to send ANY of your tracking links to, you simply need that number, and the ID of the tracking link you wish to send, which is available on the links page in the Portal. With that information, you can make a call to the XML API requesting that a link be generated and sent to that number, using the following XML:

<campaign> <header uid='[USERID]' pwd='[PASSWORD]' action='SEND_LINK'/> <body> <msg>This is the message body, and you can include the link in the message body by putting [LINK] in the text</msg> <phone>[TARGET PHONE NUMBER]</phone> <linkid>[LINK ID]</linkid> </body> </campaign>

If you don't include the tag [LINK] in the message text, then the message will add the link at the end. If your request is successful, you will receive the following XML back.

<msg msisdn='[TARGET PHONE NUMBER]' response='OK' id='[LINK TRACKING CODE]' />

The link tracking code is the code that was sent to the user, so you can keep your own records and double check against our own checking systems.

In Conclusion

There are thousands of permutations for setting up tools and systems using our click tracking systems, and if you're not sure how to achieve the result/effect you want, contact us for help and advice.