Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Track os of the user (lib)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Jan 29, 2018
1 parent 1d85499 commit c68f5b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/analytics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ void Analytics::TrackChannel(const std::string client_id,
Track(client_id, "channel", ss.str());
}

void Analytics::TrackOs(const std::string client_id,
const std::string os) {
std::stringstream ss;
ss << "os-"
<< os;

Track(client_id, "os", ss.str());
}

void Analytics::TrackSettings(const std::string client_id,
const bool record_timeline,
const Settings settings,
Expand Down
4 changes: 4 additions & 0 deletions src/analytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Analytics : public Poco::TaskManager {
const std::string client_id,
const std::string channel);

void TrackOs(
const std::string client_id,
const std::string os);

void TrackSettings(
const std::string client_id,
const bool record_timeline,
Expand Down
7 changes: 7 additions & 0 deletions src/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ error Context::StartEvents() {
UpdateChannel(&update_channel);

analytics_.TrackChannel(db_->AnalyticsClientID(), update_channel);

std::stringstream os_info;
os_info << Poco::Environment::osName()
<< Poco::Environment::osVersion()
<< Poco::Environment::osArchitecture();

analytics_.TrackOs(db_->AnalyticsClientID(), os_info.str());
}
} catch(const Poco::Exception& exc) {
return displayError(exc.displayText());
Expand Down

0 comments on commit c68f5b5

Please sign in to comment.