How to create a tracking link

This task only need one simple POST request to ClickMeter’s APIs.



$body = array(

'type' => 0,

'title' => "A friendly name",

'groupId' => $TL_campaign_id,

'name' => $custom_name,

'typeTL' => array(

 'domainId' => $domainId,

 'redirectType' => $redirectType,

 'url' => $destination_url



$output = api_request('', 'POST', json_encode($body) , $api_key);



This request needs a body to carry arguments, in JSON format. Here are showed the minimum number of parameters necessary to get a successful creation:

  • type: the type of datapoint to be created, 0 for tracking link, 1 for tracking pixel.

  • title: a friendly name to display the created tracking pixel into ClickMeter.

  • groupId: the identifier of the campaign that will contain the created tracking link. ks.

  • name: the custom name that will appear in the tracking link URI. For instance

  • domainId: the identifier number of the domain used to create the tracking link. For instance, it will correspond to or or any other personal or dedicated domain created by the user (get it from /domains endpoint).

  • redirectType: is an enum (allowed values are 301 or 307) it determines the response status code for the redirect
  • url: the destination URL which visitors will be redirected.

Return value:

The response body will contain the id of the created tracking link.

Have more questions? Submit a request


Article is closed for comments.