Dynamic Short Links and Referral Tracking

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:


Creating Dynamic Short Links


Create a Singular Link

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


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

The result may look as follows:


(Optional) Add Custom Passthrough Information to the Link

You can pass additional information to your app through the tracking link using the "_p" parameter. This parameter can accept a string or a JSON object (as long as it's URL-encoded).

For example, say you want to pass the following dynamic information to your app through the tracking link:


You can URL-encode it and append it to the _p parameter in your tracking link:


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".



Create One or More Short Links

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


  • 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
{"long_link": "<LONG LINK>"}

For exmaple:

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

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

{"short_link": "https://my.sng.link/Dapp/linkid/r_ninja123"}