Once the CMP has been loaded, the __tcfapi method is created, which is used to retrieve the consent string, get consent for a specific purpose, etc. The full definition and all available standard API commands can be found at the following link.
The CMP launches a series of events predefined by the IAB to detect the following:
CMP and consent tring loaded (event 'tcloaded')
CMP is shown (event 'cmpuishown')
Consent string saved (event 'useractioncomplete')
These events are caught by the __tcfapimethod with the 'addEventListener' command.
Example:
The CMP is running on a TV device, ES6 javascript cannot be used: functions arrow, const, let, etc. ES5 must be used.
var tcLoadedCallback = function(tcData, success) {