HIVE SDK for C++

HIVE_Analytics.h
이 파일의 문서화 페이지로 가기
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
앱과 사용자를 트래킹하고 분석하기 위한 기능 모음 (User Tracking Tool Wrapper & Callect Analytics Log API)
Definition: HIVE_Analytics.h:52
static void sendUserEntryFunnelsLogs(std::string funnelTrack, std::string optionTag)
사용자의 퍼널 분석을 위한 지표를 전송한다.
static void showConsentModeIfRequire(bool checkCmp, ConsentMode *consentMode, onShowConsentMode listener)
개인 정보를 사용하는 데 최종 사용자 동의를 받기 위한 UI를 노출합니다.
static void showConsentMode(ConsentMode *consentMode, onShowConsentMode listener)
개인 정보를 사용하는 데 최종 사용자 동의를 받기 위한 UI를 노출합니다.
static std::map< std::string, std::string > getConsent(std::string providerName)
각 provider별 setConsent 으로 설정한 동의 유형별 동의 상태를 반환한다.
static void setConsent(std::string providerName, std::map< std::string, std::string > settings)
각 Provider 별로 서드 파티 동의 관리 플랫폼(CMP) 또는 맞춤 솔루션으로 구현한 최종 사용자 동의 상태를 설정한다.
Definition: HIVE_ResultAPI.h:64
static void sendEvent(std::string eventName)
사용자 분석을 위한 사용자 정보 이벤트 설정
static void setEnableTrackerWithName(std::string name, bool isEnable)
사용자 분석을 위한 사용자 정보 트래커 사용 유무 설정
static bool sendAnalyticsLog(picojson::object &logData)
분석용 로그 전송.
TrackingType
사용자 분석을 위한 서드 파티 트래커 형태
Definition: HIVE_Analytics.h:64
static void sendEventWithAttributes(std::string eventName, AnalyticsAttributes const &attributes)
사용자 분석을 위한 사용자 정보 이벤트 설정
static void setEnableTracker(TrackingType trackingType, bool isEnable)
사용자 분석을 위한 사용자 정보 트래커 사용 유무 설정
static void sendAdRevenueEvent(AnalyticsAdRevenue analyticsAdRevenue)
광고 수익 측정 이벤트 설정
Copyright © Com2uS Platform Corporation. All Right Reserved. 이용약관 개인정보 처리방침