Dynamic Short Links and Referral Tracking - Beta

Many app and website owners let customers invite their friends to the product, hoping to achieve an organic uplift. Growth teams want to track these invites and measure their impact on the overall growth, while also answering questions such as:

  • Which users drive the most amount of invites?
  • How can we acquire more users like them?
  • Who should the credit for the invite go to (when relevant)?

With Singular's infrastructure, inviting someone to the app is as simple as sending them a link. But we want to append some data on top of that link (e.g., the user ID of the referring user), and also shorten it so that the information remains private, secure, and unchanged. Shortening also prevents the link from becoming too long and unappealing to users.

The Dynamic Short Links API lets you transform long, parameter-filled Singular Links into shorter, secure and appealing links:

Before:
https://my.sng.link/Dappid/linkid?referring_user_id=123&referring_user_name=john&channel=sms
After:
https://my.sng.link/Dappid/linkid/r_hiuxchas8h

Creating Dynamic Short Links

1

Create a Singular Link

Go to Attribution > Manage Links and create a new link. See the Singular Links FAQ for help.

2

Add Parameters to the Link

Once you have the link URL, we recommend appending the following parameters. The data you add will be made available to you in reports or exports.

URL parameter Description Included in reports? Included in Data Destinations (ETL)?
pcn Campaign Name Yes Yes
referring_user_id Your user ID for the referring user No Yes
referring_user_name Your name for the referring user No Yes
3

Retrieve Your Singular SDK API KEY

Retrieve your Singular SDK API Key by going to Settings > SDK Keys and copying the value next to "API Key".

screenshot-app.singular.net-2021.12.23-16_26_13.png

4

Create One or More Short Links

Use the Dynamic Short Links API endpoint to create a short link.

Note:

  • The endpoint is https://s2s.singular.net/api/v1/s2s/shorten_link?a=<SDK API KEY> where <SDK API KEY> is the API Key you retrieved in the previous step.
  • In the JSON parameters, pass the URL you want to shorten.
Endpoint https://s2s.singular.net/api/v1/s2s/shorten_link?a=<SDK API KEY>
Method POST
JSON Body
{"long_link": "<LONG LINK>"}

For exmaple:

{"long_link": "https://my.sng.link/Dappid/linkid?referring_user_id=123&referring_user_name=john&channel=sms"}
Response

The response (in JSON format) contains a shortened link:

{"short_link": "https://my.sng.link/Dapp/linkid/r_ninja123"}
Was this article helpful?