QInsightTracker Class
Control the Qt Insight Tracker and send events to the back-end server. More...
Header: | #include <QInsightTracker> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS InsightTracker) target_link_libraries(mytarget PRIVATE Qt6::InsightTracker) |
qmake: | QT += insighttracker |
Instantiated By: | InsightTracker |
Inherits: | QObject |
Public Functions
QInsightTracker() | |
~QInsightTracker() | |
void | clearCache() |
QInsightConfiguration * | configuration() const |
bool | isEnabled() const |
void | sendClickEvent(const QString &name, const QString &category, int x, int y) const |
void | sendClickEvent(const QString &name, const QString &category, int x, int y, const QString &contextKey, double contextValue) const |
void | sendScreenView(const QString &name) const |
void | sendScreenView(const QString &name, const QString &contextKey, double contextValue) const |
void | setEnabled(bool enabled) |
void | startNewSession() |
Detailed Description
QInsightTracker provides a C++ API that can be used to control the tracker and to send events to the back-end server.
Member Function Documentation
QInsightTracker::QInsightTracker()
Constructs a tracker object. All tracker objects share the same back-end server and configuration.
[default]
QInsightTracker::~QInsightTracker()
Destroys the tracker object and frees all allocated resources.
void QInsightTracker::clearCache()
Clear all events from the local cache.
QInsightConfiguration *QInsightTracker::configuration() const
Configure the tracker
See also QInsightConfiguration.
bool QInsightTracker::isEnabled() const
Is tracking enabled. Returns true if tracking is enabled
See also QInsightTracker::setEnabled.
void QInsightTracker::sendClickEvent(const QString &name, const QString &category, int x, int y) const
Send a click event name. Event can have extra details with category and click coordinates x and y.
void QInsightTracker::sendClickEvent(const QString &name, const QString &category, int x, int y, const QString &contextKey, double contextValue) const
This is an overloaded function.
Send a click event name with additional context data. Event can have extra details with category and click coordinates x and y. Additional context data can be sent as a key/value pair in contextKey and contextValue.
void QInsightTracker::sendScreenView(const QString &name) const
Send a screen view event name.
void QInsightTracker::sendScreenView(const QString &name, const QString &contextKey, double contextValue) const
This is an overloaded function.
Send a screen view event name with additional context data. Additional context data can be sent as a key/value pair in contextKey and contextValue.
void QInsightTracker::setEnabled(bool enabled)
Enable or disable tracking.
See also QInsightTracker::isEnabled.
void QInsightTracker::startNewSession()
Start a new session A new session id is generated and then used in all subsequent events.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.