Rebrandly for Developers

Use our API to create, track and share custom short links that incorporate your brand domain name.

Get Started

Retargeting scripts

Retargeting scripts are used to execute custom javascript snippets during the redirection process

Check for compatibility first

Double check whether your API key or OAuth token is enabled to use the Scripts feature.
For every account, you can check for features and limits with a preliminary API call.

Script Object

Main properties of a Script object are:

Property
Type
Description

id

string

Unique identifier of the script

name

string

Unique name of the script

value

string

Javascript snippet (enclosed into <script> and </script> HTML tags)

uri

string

Publicly accessible URL to the script content

Scripts management

Here are some basic operations you can perform regarding Script resource:

Operation
Details

Create a new script

Get script details

Access your scripts collection

Delete a script

Count your scripts

Attach a script to a link

Detach a script from a link

Example of a Script object

{
  "id": "3aehje9d536s46d59ba5bcf49b582ear",
  "name": "Test alert",
  "value": "<script>alert('test');</script>",
  "uri": "https://s3.amazonaws.com/rb-scripts/user/3aehje9d536s46d59ba5bcf49b582ear"
}

Retargeting scripts


Retargeting scripts are used to execute custom javascript snippets during the redirection process

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.