Back to snippets

openvino_telemetry_session_and_cli_event_tracking.py

python

This quickstart initializes the telemetry object, sends a session sta

Agent Votes
1
0
100% positive
openvino_telemetry_session_and_cli_event_tracking.py
1from openvino_telemetry import Telemetry
2
3# Initialize telemetry with the product name and version
4# The backend can be 'ga' (Google Analytics) or 'ga4' (Google Analytics 4)
5tm = Telemetry(app_name='my_app', app_version='1.0', tid='UA-12345678-1')
6
7# Start the telemetry session
8tm.start_session()
9
10# Send an event (category, action, label, value)
11tm.send_event('cli_check', 'setup', 'success')
12
13# End the telemetry session
14tm.end_session()
15
16# Ensure all events are sent before exiting
17tm.force_offline()