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.
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:
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:
let tracker = Tracker()
val tracker = Tracker()
echo "Hello World!"
The NPOContext is used to initialise the NPOTag oject.
field | field type | required | comments |
---|---|---|---|
debug | boolean | false | set 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) |
brand | string | true | |
brand_id | int | true | |
chapter_1 | string | false | |
chapter_2 | string | false | |
chapter_3 | string | false | |
page | string | false | |
platform | string | true | |
content_context_id | string | false | separate field for things that used to be stored in the ‘page’ |
user_profile | string | false | |
user_subscription | string | false | |
user_pseudoid | string | false | new ID type that will be used by platforms leveraging the new NPO-ID |
query_context | string | false | the query that generated the result page a user is on |
condition | string | false | A/B condition indicator |
platform_version | string | true | |
use_at | boolean | true | set the use of the AT Internet plugin |
use_govolte | boolean | true | whether to use the govolte plugin |
custom_label1 | string | false | free-form string variables for backward compatibility |
custom_label2 | string | false | free-form string variables for backward compatibility |
custom_label3 | string | false | free-form string variables for backward compatibility |
custom_label4 | string | false | free-form string variables for backward compatibility |
custom_label5 | string | false | free-form string variables for backward compatibility |
error_code | string | false | arbitrary error code when reaching an error page |
location | string | false | |
referrer | string | false | |
broadcasters | string | false | a string value, where implementers fill in a _ |
program | string | false | lowercased, whitespace stripped name of a program on the page, filled in by implementers |