[statistics][bookmarks] content deleted event is added.

This commit is contained in:
Arsentiy Milchakov 2020-07-27 11:13:15 +03:00 committed by Anatoliy V. Tomilov
parent 540e2edd6e
commit fec48b34b1
4 changed files with 27 additions and 4 deletions

View file

@ -47,6 +47,8 @@
#include "3party/Alohalytics/src/alohalytics.h"
#include "private.h"
using namespace std::placeholders;
namespace
@ -3737,7 +3739,7 @@ void BookmarkManager::CheckExpiredCategories(CheckExpiredCategoriesHandler && ha
for (auto const & category : m_categories)
{
if (category.second->GetServerId() == s)
m_expiredCategories.emplace_back(category.first);
m_expiredCategories.emplace_back(category.first, category.second->GetServerId());
}
}
if (handler)
@ -3755,8 +3757,19 @@ void BookmarkManager::DeleteExpiredCategories()
return;
auto session = GetEditSession();
for (auto const markGroupId : m_expiredCategories)
DeleteBmCategory(markGroupId);
std::string serverIds;
for (auto const & [id, serverId] : m_expiredCategories)
{
DeleteBmCategory(id);
serverIds += serverIds.empty() ? "" : "," + serverId;
}
auto const now = GetPlatform().GetMarketingService().GetPushWooshTimestamp();
GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kSubscriptionContentDeleted, now);
alohalytics::Stats::Instance().LogEvent("InAppPurchase_Content_deleted",
{{"vendor", BOOKMARKS_SUBSCRIPTION_VENDOR}, {"purchases", serverIds}});
}
void BookmarkManager::ResetExpiredCategories()

View file

@ -867,7 +867,15 @@ private:
};
std::map<std::string, RestoringCache> m_restoringCache;
std::vector<kml::MarkGroupId> m_expiredCategories;
struct ExpiredCategory
{
ExpiredCategory(kml::MarkGroupId id, std::string const & serverId)
: m_id(id), m_serverId(serverId) {}
kml::MarkGroupId m_id;
std::string m_serverId;
};
std::vector<ExpiredCategory> m_expiredCategories;
struct Properties

View file

@ -36,6 +36,7 @@ char const * const kSubscriptionBookmarksSightsDisabled =
"bookmark_catalog_subscription_city_disabled";
char const * const kRemoveAdsSubscriptionEnabled = "remove_ads_subscription_enabled";
char const * const kRemoveAdsSubscriptionDisabled = "remove_ads_subscription_disabled";
char const * const kSubscriptionContentDeleted = "bookmark_catalog_subscription_content_deleted";
// Events.
char const * const kDownloaderMapActionFinished = "Downloader_Map_action_finished";

View file

@ -36,6 +36,7 @@ extern char const * const kSubscriptionBookmarksSightsEnabled;
extern char const * const kSubscriptionBookmarksSightsDisabled;
extern char const * const kRemoveAdsSubscriptionEnabled;
extern char const * const kRemoveAdsSubscriptionDisabled;
extern char const * const kSubscriptionContentDeleted;
// Events.
extern char const * const kDownloaderMapActionFinished;