This task only need one simple POST request to ClickMeter’s APIs.
$body = array(
'type' => 1,
'title' => "A friendly name",
"groupId" => $TP_campaing_id
$json = api_request('http://apiv2.clickmeter.com/datapoints', '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 pixel. ClickMeter’s WordPress plugin creates one campaign for tracking pixel and one for tracking links.
The response body will contain the id of the created tracking pixel.