HIVE SDK for C++

HIVE_Analytics.h
Go to the documentation of this file.
1
16#ifndef __HIVE_ANALYTICS_H__
17#define __HIVE_ANALYTICS_H__
18
19
20#include "HIVE_ResultAPI.h"
21#include <map>
22
23NS_HIVE_BEGIN
24
25class AnalyticsAdRevenue;
26class ConsentStatus;
27class ConsentForm;
28class ConsentMode;
30class IAnalyticsSpecific;
32
33#define HIVE_SDK_ANALYTICS_CONSENT_TYPE_AD_STORAGE "ad_storage"
34#define HIVE_SDK_ANALYTICS_CONSENT_TYPE_AD_USER_DATA "ad_user_data"
35#define HIVE_SDK_ANALYTICS_CONSENT_TYPE_AD_PERSONALIZATION "ad_personalization"
36#define HIVE_SDK_ANALYTICS_CONSENT_TYPE_ANALYTICS_STORAGE "analytics_storage"
37#define HIVE_SDK_ANALYTICS_CONSENT_GRANTED "granted"
38#define HIVE_SDK_ANALYTICS_CONSENT_DENIED "denied"
39
51class HIVESDK_DLLEXPORT Analytics
52{
53public:
54
63 enum class TrackingType
64 {
65 ADJUST
66 , SINGULAR
67 , APPSFLYER
68 , UNKNOWN
69 };
70
71 typedef std::function<void(ResultAPI const & result, std::vector<ConsentStatus> const & consentStatus)> onShowConsentMode;
72
88 static bool sendAnalyticsLog(picojson::object & logData);
89
90
104 static void setEnableTracker(TrackingType trackingType, bool isEnable);
105
106
120 static void setEnableTrackerWithName(std::string name, bool isEnable);
121
122
123
135 static void sendEvent(std::string eventName);
136
150 static void sendEventWithAttributes(std::string eventName, AnalyticsAttributes const& attributes);
151
164 static void sendAdRevenueEvent(AnalyticsAdRevenue analyticsAdRevenue);
165
166 static unsigned int getRemainAnalyticsLogCount();
167
168
210 static void sendUserEntryFunnelsLogs(std::string funnelTrack, std::string optionTag);
211
222 static void setConsent(std::string providerName, std::map<std::string, std::string> settings);
223
231 static std::map<std::string, std::string> getConsent(std::string providerName);
232
247 static void showConsentModeIfRequire(bool checkCmp, ConsentMode* consentMode, onShowConsentMode listener);
248
262 static void showConsentMode(ConsentMode* consentMode, onShowConsentMode listener);
263
264
265 // Native 영역에서 호출된 요청을 처리하기 위한 플러그인 내부 코드
266 static void executeEngine(picojson::value jsonParam);
267};
268
269class HIVESDK_DLLEXPORT AnalyticsAdRevenue
270{
271public:
272
273 double revenue;
274
275 std::string adPlatform;
276
277 std::string adUnitId;
278
279 std::string adType;
280
281 std::string adPlacement;
282
283 std::string currency;
284
285 AnalyticsAdRevenue();
286
287 AnalyticsAdRevenue(double revenue, std::string adPlatform, std::string adUnitId, std::string adType, std::string adPlacement, std::string currency);
288
289 AnalyticsAdRevenue(picojson::value jsonParam);
290
291 picojson::object toJson() const;
292
293 std::string toString() const;
294};
295
296class HIVESDK_DLLEXPORT ConsentStatus {
297public:
298 std::string providerName;
299 std::string consentForDataUsage;
300 std::string consentForPersonalization;
301 long consentDate;
302 long expiredDate;
303
304 ConsentStatus();
305 ConsentStatus(picojson::value jsonParam);
306
307 picojson::object toJson() const;
308 std::string toString() const;
309};
310
311class HIVESDK_DLLEXPORT ConsentForm {
312public:
313 std::string providerName;
314 int retentionPeriod;
315 std::string dataUsageTitle;
316 std::string dataUsageDescription;
317 std::string personalizationTitle;
318 std::string personalizationDescription;
319
320 ConsentForm();
321 ConsentForm(picojson::value jsonParam);
322
323 picojson::object toJson() const;
324 std::string toString() const;
325};
326
327class HIVESDK_DLLEXPORT ConsentMode {
328public:
329 std::string title;
330 std::string companyName;
331 std::string privacyPolicy;
332 ConsentForm* mainForm;
333 std::vector<ConsentForm> formList;
334
335 ConsentMode();
336 ~ConsentMode();
337 ConsentMode(picojson::value jsonParam);
338
339 picojson::object toJson() const;
340 std::string toString() const;
341};
342
348class HIVESDK_DLLEXPORT AnalyticsAttributes
349{
350public:
351 picojson::object customAttributes;
352 picojson::object moduleSpecificAttributes;
353
355
356 void addCustomAttribute(const std::string& key, const picojson::value& value);
357 void addModuleSpecificAttribute(const IAnalyticsSpecific& specific);
358
359 virtual picojson::object toJson() const;
360 virtual std::string toString() const;
361
362 virtual ~AnalyticsAttributes() = default; // 가상 소멸자
363};
364
365class HIVESDK_DLLEXPORT IAnalyticsSpecific
366{
367public:
368 std::string providerName;
369
370 IAnalyticsSpecific();
371
372 virtual picojson::object toJson() const;
373 virtual std::string toString() const;
374
375 virtual ~IAnalyticsSpecific() = default; // 가상 소멸자
376};
377
384class HIVESDK_DLLEXPORT AirbridgeSpecific : public IAnalyticsSpecific
385{
386public:
387 picojson::object semanticAttributes;
388
390
391 void setSemanticAction(const std::string& value);
392 void setSemanticLabel(const std::string& value);
393 void setSemanticValue(const double value);
394 void addSemanticAttribute(const std::string& key, const picojson::value& value);
395 picojson::object toJson() const override; // 부모 메서드 재정의
396 std::string toString() const override; // 부모 메서드 재정의
397};
398
399NS_HIVE_END // namespace hive
400
401#endif // __HIVE_ANALYTICS_H__
Analytics 추가 데이터 (Airbridge 추가 데이터 포함)
Definition: HIVE_Analytics.h:385
Analytics 추가 데이터
Definition: HIVE_Analytics.h:349
A collection of features for tracking and analyzing apps and users (User Tracking Tool Wrapper & Cal...
Definition: HIVE_Analytics.h:52
Definition: HIVE_ResultAPI.h:64
static void sendEvent(std::string eventName)
Send event for user analysis.
static void setEnableTrackerWithName(std::string name, bool isEnable)
Set whether to use User Information Tracker for user analysis.
static bool sendAnalyticsLog(picojson::object &logData)
Send log for analysis.
TrackingType
Tracker type for user analysis.
Definition: HIVE_Analytics.h:64
static void sendEventWithAttributes(std::string eventName, AnalyticsAttributes const &attributes)
Send event for user analysis.
static void setEnableTracker(TrackingType trackingType, bool isEnable)
Set whether to use User Information Tracker for user analysis.
static void sendAdRevenueEvent(AnalyticsAdRevenue analyticsAdRevenue)
Send events for ad revenue measurement.
Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy