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
246 static void showConsentModeIfRequire(bool checkCmp, ConsentMode* consentMode, onShowConsentMode listener);
247
260 static void showConsentMode(ConsentMode* consentMode, onShowConsentMode listener);
261
262
263 // Native 영역에서 호출된 요청을 처리하기 위한 플러그인 내부 코드
264 static void executeEngine(picojson::value jsonParam);
265};
266
267class HIVESDK_DLLEXPORT AnalyticsAdRevenue
268{
269public:
270
271 double revenue;
272
273 std::string adPlatform;
274
275 std::string adUnitId;
276
277 std::string adType;
278
279 std::string adPlacement;
280
281 std::string currency;
282
283 AnalyticsAdRevenue();
284
285 AnalyticsAdRevenue(double revenue, std::string adPlatform, std::string adUnitId, std::string adType, std::string adPlacement, std::string currency);
286
287 AnalyticsAdRevenue(picojson::value jsonParam);
288
289 picojson::object toJson() const;
290
291 std::string toString() const;
292};
293
294class HIVESDK_DLLEXPORT ConsentStatus {
295public:
296 std::string id;
297 std::string granted;
298 long consentDate;
299 long expiredDate;
300
301 ConsentStatus();
302 ConsentStatus(picojson::value jsonParam);
303
304 picojson::object toJson() const;
305 std::string toString() const;
306};
307
308class HIVESDK_DLLEXPORT ConsentForm {
309public:
310 std::string id;
311 int retentionPeriod;
312 std::string title;
313 std::string content;
314 std::vector<ConsentForm> subForms;
315
316 ConsentForm();
317 ConsentForm(picojson::value jsonParam);
318
319 picojson::object toJson() const;
320 std::string toString() const;
321};
322
323class HIVESDK_DLLEXPORT ConsentMode {
324public:
325 std::string title;
326 std::string companyName;
327 std::string privacyPolicy;
328 ConsentForm* adUserData;
329 ConsentForm* adPersonalization;
330 ConsentForm* analyticsStorage;
331
332 ConsentMode();
333 ~ConsentMode();
334 ConsentMode(picojson::value jsonParam);
335
336 picojson::object toJson() const;
337 std::string toString() const;
338};
339
345class HIVESDK_DLLEXPORT AnalyticsAttributes
346{
347public:
348 picojson::object customAttributes;
349 picojson::object moduleSpecificAttributes;
350
352
353 void addCustomAttribute(const std::string& key, const picojson::value& value);
354 void addModuleSpecificAttribute(const IAnalyticsSpecific& specific);
355
356 virtual picojson::object toJson() const;
357 virtual std::string toString() const;
358
359 virtual ~AnalyticsAttributes() = default; // 가상 소멸자
360};
361
362class HIVESDK_DLLEXPORT IAnalyticsSpecific
363{
364public:
365 std::string providerName;
366
367 IAnalyticsSpecific();
368
369 virtual picojson::object toJson() const;
370 virtual std::string toString() const;
371
372 virtual ~IAnalyticsSpecific() = default; // 가상 소멸자
373};
374
381class HIVESDK_DLLEXPORT AirbridgeSpecific : public IAnalyticsSpecific
382{
383public:
384 picojson::object semanticAttributes;
385
387
388 void setSemanticAction(const std::string& value);
389 void setSemanticLabel(const std::string& value);
390 void setSemanticValue(const double value);
391 void addSemanticAttribute(const std::string& key, const picojson::value& value);
392 picojson::object toJson() const override; // 부모 메서드 재정의
393 std::string toString() const override; // 부모 메서드 재정의
394};
395
396NS_HIVE_END // namespace hive
397
398#endif // __HIVE_ANALYTICS_H__
Analytics 추가 데이터 (Airbridge 추가 데이터 포함)
Definition: HIVE_Analytics.h:382
Analytics 추가 데이터
Definition: HIVE_Analytics.h:346
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