home > support > API > Marketplace API > channel performance
List top 50 channels by number of unique visitor clicks (or check performance for a specific channel).
For use by Agent/Affiliate accounts only, not available to Tour Operator accounts.
Endpoint | /p/channels/performance /c/channel/performance |
Formats | XML |
Example | /p/channels/performance.xml |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object channel_performance ( [ int $channel = 0 ] )
// Optionally set a Channel ID, leave as 0 to return top 50
$channel = 0;
// Query the TourCMS API
$results = $tourcms->channel_performance($channel);
// Loop through each channel
foreach($results->channel as $channel) {
// Print out the channel name
print $channel->channel_name;
// Print out the number of unique visitors
print " (Unique visitors: ".$channel->unique_visitors;
// If we have sufficient permission show the amount of commission
if($channel->connection_permission > 1)
print ", Commission: ".$channel->commission_display;
// Close brackets and create a new line
print ")<br />";
}
Example Tours (Unique visitors: 10, Commission £50.00)
Operator two (Unique visitors: 20)
Another operator name (Unique visitors 30, Commission: US$40.00)
C# examples use the .Net Client Library
XmlDocument ChannelPerformance ()
XmlDocument ChannelPerformance (int channelId)
// Optionally set a Channel ID, leave as 0/blank to return top 50
int channelId = 0;
// Query the TourCMS API
XmlDocument doc = myTourCMS.ChannelPerformance(channelId);
// Display Channel list
XmlNodeList chanList = doc.GetElementsByTagName("channel");
For Each channel As XmlNode In chanList
{
string chanName = channel.SelectSingleNode("channel_name").InnerText;
string uniques = channel.SelectSingleNode("unique_visitors").InnerText;
Console.WriteLine(chanName + "(Unique visitors: " + uniques + ")");
}
Example Tours (Unique visitors: 10)
Operator two (Unique visitors: 20)
Another operator name (Unique visitors 30)
VB examples use the .Net Client Library
XmlDocument ChannelPerformance ()
XmlDocument ChannelPerformance (int channelId)
' Optionally set a Channel ID, leave as 0/blank to return top 50
Dim channelId As Integer = 0
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.ChannelPerformance(channelId)
' Display Channel list
Dim chanList As XmlNodeList = doc.GetElementsByTagName("channel")
foreach (XmlNode channel in chanList)
{
Dim chanName As string = channel.SelectSingleNode("channel_name").InnerText
Dim uniques As string = channel.SelectSingleNode("unique_visitors").InnerText
Console.WriteLine(chanName & "(Unique visitors: " & uniques & ")")
}
Example Tours (Unique visitors: 10)
Operator two (Unique visitors: 20)
Another operator name (Unique visitors 30)
NodeJS examples use the NodeJS Wrapper
TourCMS.channelPerformance({
channelId: 3930,
callback: function(response) {
console.log(response);
}
});
Looking for sample code in a different language? TourCMS and community provided API libraries
Implementing yourself? Check the REST info for this endpoint.
Enter your TourCMS API credentials below to call the List Channel Performance endpoint.
There are no querystring parameters supported by this method.
Some fields are only returned if the Channel has granted you permission level 2 or above.
The channel permission level is returned as part of the response. You can also check permissions on your channels via the Your connections section of your control panel or by calling the Show Channel API call.
XML Node | Notes |
---|---|
request | Confirmation of the request that you sent |
error | Any error message returned, if there is no error this will just contain the text OK |
report_start_date | Start date for the range of dates included in the report |
report_end_date | End date for the range of dates included in the report | channel |
There will be one channel node for channel returned Each channel node contains the following child nodes.
|