General information when implementing the NPO Tag

Before getting started it is good to understand how the NPO Tag SDK works, what the main concepts are and how you can use them.

Plugins

When initializing the NPOTag, you’ll have to specify which plugins you’re integrating. Plugins correspond to the data collectors that you want to use. Right now, there are two supported plugins:

  • GoVolte
  • ATInternet

Trackers

Trackers are the objects that actually collect data and send it to the different plugins. There are different trackers for different needs. The tracker that you’ll most probably use the most is the PageTracker. The trackers that are currently available are:

  • PageTracker
  • StreamTracker
  • RecommendationsTracker
let tracker = Tracker()
val tracker = Tracker()
echo "Hello World!"

Events

NPOContext

The NPOContext is used to initialise the NPOTag oject.

fieldfield typerequiredcomments
debugbooleanfalseset to 1) enable logging to console for non-critical errors, 2) provide logs of each event send to each plugin, 3) send events to development environment (if applicable to plugin)
brandstringtrue
brand_idinttrue
chapter_1stringfalse
chapter_2stringfalse
chapter_3stringfalse
pagestringfalse
platformstringtrue
content_context_idstringfalseseparate field for things that used to be stored in the ‘page’
user_profilestringfalse
user_subscriptionstringfalse
user_pseudoidstringfalsenew ID type that will be used by platforms leveraging the new NPO-ID
query_contextstringfalsethe query that generated the result page a user is on
conditionstringfalseA/B condition indicator
platform_versionstringtrue
use_atbooleantrueset the use of the AT Internet plugin
use_govoltebooleantruewhether to use the govolte plugin
custom_label1stringfalsefree-form string variables for backward compatibility
custom_label2stringfalsefree-form string variables for backward compatibility
custom_label3stringfalsefree-form string variables for backward compatibility
custom_label4stringfalsefree-form string variables for backward compatibility
custom_label5stringfalsefree-form string variables for backward compatibility
error_codestringfalsearbitrary error code when reaching an error page
locationstringfalse
referrerstringfalse
broadcastersstringfalsea string value, where implementers fill in a _
programstringfalselowercased, whitespace stripped name of a program on the page, filled in by implementers