home > support > API > Marketplace API > channel performance

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.

REST info

Endpoint/p/channels/performance
/c/channel/performance
FormatsXML
Example/p/channels/performance.xml
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object channel_performance ( [ int $channel = 0 ] )


Parameters

$channel
Use to get the performance stats just for a specific channel

Example

// 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

Overload list

XmlDocument ChannelPerformance ()
XmlDocument ChannelPerformance (int channelId)


Parameters

channelId
Optional, return stats on a single channel

Example

// 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

Overload list

XmlDocument ChannelPerformance ()
XmlDocument ChannelPerformance (int channelId)


Parameters

channelId
Optional, return stats on a single channel

Example

' 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


Example

TourCMS.channelPerformance({
  channelId: 3930,
  callback: function(response) {
    console.log(response);
  }
});

Looking for sample code in a different language? TourCMS and community provided API libraries

Querystring parameters

There are no querystring parameters supported by this method.

Response fields

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.

Response fields
XML NodeNotes
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.

XML NodeNotes
Returned for all Channels
channel_idChannel ID
account_idAccount ID
channel_nameChannel name
connection_permissionPermission level granted by the Channel owner (1 to 3) view full list.
unique_visitorsThe number of individual visitors clicking through, e.g. if one visitor clicks several times they will only be counted here once. May be prefaced with a "~" if you are connected to this TourCMS account via multiple channels, used to indicate that we can't say which channel a click went via, just that it came from you to that account
Only returned if the Channel has granted permission level 2 or above
total_bookingsTotal number of bookings associated with you
total_customersTotal number of customers associated with you (a booking can contain multiple customers)
open_enquiriesNumber of open enquiries associated with you
closed_enquiries_successNumber of closed enquiries associated with you that were closed as a success (customer query solved or they went on to book)
closed_enquiries_failureNumber of closed enquiries associated with you that were closed as a failure (customer query not solved or they did not go on to book)
sales_revenueAmount of revenue generated for the channel by your relationship (e.g. 100.00)
sale_currencyCurrency for the sale_revenue (e.g. GBP, USD, EUR etc)
sales_revenue_displayA nicer display presentation of the sales_revenue including currency symbol where applicable. (e.g. US$100.00)
commissionAmount of commission generated to you (e.g. 20.00)
commission_taxAmount of tax on the commission (e.g. 2.75)
commission_currencyCurrency for the commission amounts (e.g. GBP, USD, EUR etc)
commission_displayA nicer display presentation of the commission including currency symbol where applicable. (e.g. US$20.00)
commission_tax_displayA nicer display presentation of the commission tax including currency symbol where applicable. (e.g. US$2.75)
click2bookNumber of clicks required for a booking. May be prefaced with a "~" if you are connected to the account behind the channel via multiple channels, used to indicate that we can't say which channel a click went via, just that it came from you to that account
commercial_avclick2book_privateAverage number of unique visitors (via tracking script) to deliver 1 booking. This is accross all of their connections (i.e. not just to you) and matches the number available via the Show Channel API method.

More information