@thinkingai/ae-cli 1.0.30 → 6.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-U25QJU5D.js → auth-DYC2BGLM.js} +2 -3
- package/dist/{auth-H3GJD55A.js → auth-GHBMJ5ZR.js} +33 -17
- package/dist/{chunk-CLJF7MQA.js → chunk-2DUEAXV3.js} +1 -1
- package/dist/{chunk-SF3KTPIC.js → chunk-5OC7CYCG.js} +2 -2
- package/dist/{chunk-SRJIAOBN.js → chunk-6W4QOZAL.js} +10 -0
- package/dist/{chunk-I42JGQ2J.js → chunk-BJX3GXWC.js} +3 -5
- package/dist/{chunk-GLNZSDKO.js → chunk-DMMEPCST.js} +4 -6
- package/dist/{chunk-VJFUB3H3.js → chunk-I5CRVM2S.js} +3 -3
- package/dist/{chunk-GSJGPNKK.js → chunk-PN3OS34E.js} +1 -1
- package/dist/{chunk-JM34JPCO.js → chunk-RSHMZ3LG.js} +178 -4
- package/dist/{client-IN42F223.js → client-2UJ63MVQ.js} +3 -4
- package/dist/{config-64G36TJL.js → config-NCUGK6NS.js} +3 -3
- package/dist/index.js +2526 -28
- package/dist/{model-VZCYNIOG.js → model-SJSOZTRS.js} +2 -2
- package/dist/{raw-WJIWC6YP.js → raw-7NVWSVJP.js} +5 -7
- package/dist/{sync-NVASAISS.js → sync-GRVO4K3U.js} +3 -3
- package/dist/{te-agent-YV4DXEXK.js → te-agent-KZRIEN4N.js} +468 -46
- package/dist/{te-analysis-CB3DA5I5.js → te-analysis-VAR4KUOK.js} +144 -29
- package/dist/{te-audience-W7SCQFC7.js → te-audience-KMKYI2YJ.js} +22 -15
- package/dist/{te-common-FBXVWBSI.js → te-common-WNCZB7R7.js} +4 -5
- package/dist/{te-community-LNVDZSGW.js → te-community-JEEFXPB3.js} +10 -11
- package/dist/{te-dataops-IPCSSWYH.js → te-dataops-GD3XBYCS.js} +11 -12
- package/dist/{te-engage-KARARMIR.js → te-engage-4XHCTS6I.js} +4 -5
- package/dist/{te-kb-2Z2CARN3.js → te-kb-B62KFP2A.js} +96 -8
- package/dist/{te-meta-PDKLMWXN.js → te-meta-EPZGQN56.js} +9 -10
- package/dist/{te-team-SW5B7DHO.js → te-team-YY24VORI.js} +6 -7
- package/dist/tracking/i18n/resources/cli/en.json +153 -0
- package/dist/tracking/i18n/resources/cli/ja.json +153 -0
- package/dist/tracking/i18n/resources/cli/ko.json +153 -0
- package/dist/tracking/i18n/resources/cli/zh.json +153 -0
- package/package.json +9 -3
- package/skills/ae-agent/SKILL.md +65 -25
- package/skills/ae-analysis/SKILL.md +108 -8
- package/skills/ae-analysis/references/cancel_query.md +39 -0
- package/skills/ae-analysis/references/drilldown_user_events.md +4 -2
- package/skills/ae-analysis/references/drilldown_users.md +4 -2
- package/skills/ae-analysis/references/get_bi_panel_detail.md +35 -0
- package/skills/ae-analysis/references/list_alerts.md +1 -1
- package/skills/ae-analysis/references/list_bi_panels.md +35 -0
- package/skills/ae-analysis/references/list_cluster_members.md +4 -1
- package/skills/ae-analysis/references/list_dashboards.md +1 -1
- package/skills/ae-analysis/references/list_entities.md +1 -1
- package/skills/ae-analysis/references/list_events.md +1 -1
- package/skills/ae-analysis/references/list_metrics.md +1 -1
- package/skills/ae-analysis/references/list_project_mark_times.md +1 -1
- package/skills/ae-analysis/references/list_properties.md +1 -1
- package/skills/ae-analysis/references/list_public_access_links.md +1 -1
- package/skills/ae-analysis/references/list_reports.md +1 -1
- package/skills/ae-analysis/references/list_tag_members.md +4 -1
- package/skills/ae-analysis/references/query_adhoc.md +6 -5
- package/skills/ae-analysis/references/query_bi_panel_data.md +58 -0
- package/skills/ae-analysis/references/query_dashboard_report_data.md +4 -1
- package/skills/ae-analysis/references/query_entity_details.md +5 -2
- package/skills/ae-analysis/references/query_event_details.md +4 -1
- package/skills/ae-analysis/references/query_report_data.md +2 -2
- package/skills/ae-analysis-global/SKILL.md +3 -1
- package/skills/ae-analysis-intent/SKILL.md +132 -0
- package/skills/ae-data-integration-helper/SKILL.md +242 -0
- package/skills/ae-data-integration-helper/references/android_sdk_faq.md +179 -0
- package/skills/ae-data-integration-helper/references/c_sdk_compilation.md +83 -0
- package/skills/ae-data-integration-helper/references/c_sdk_faq.md +416 -0
- package/skills/ae-data-integration-helper/references/cocoscreator_sdk_faq.md +123 -0
- package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +365 -0
- package/skills/ae-data-integration-helper/references/index.md +56 -0
- package/skills/ae-data-integration-helper/references/ios_sdk_faq.md +118 -0
- package/skills/ae-data-integration-helper/references/java_sdk_faq.md +406 -0
- package/skills/ae-data-integration-helper/references/javascript_sdk_faq.md +129 -0
- package/skills/ae-data-integration-helper/references/logbus2_guide.md +309 -0
- package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +348 -0
- package/skills/ae-data-integration-helper/references/minigame_sdk_faq.md +115 -0
- package/skills/ae-data-integration-helper/references/miniprogram_sdk_faq.md +118 -0
- package/skills/ae-data-integration-helper/references/python_sdk_faq.md +232 -0
- package/skills/ae-data-integration-helper/references/restful_api_notes.md +74 -0
- package/skills/ae-data-integration-helper/references/sdk_log_guide.md +316 -0
- package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +107 -0
- package/skills/ae-data-integration-helper/references/unity_sdk_faq.md +115 -0
- package/skills/ae-generate-tracking-code/SKILL.md +629 -0
- package/skills/ae-generate-tracking-code/references/autotrack-enum.md +183 -0
- package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +202 -0
- package/skills/ae-generate-tracking-code/references/datax-config.md +43 -0
- package/skills/ae-generate-tracking-code/references/debug-script.md +102 -0
- package/skills/ae-generate-tracking-code/references/logbus-config.md +200 -0
- package/skills/ae-generate-tracking-code/references/modes.md +83 -0
- package/skills/ae-generate-tracking-code/references/restful-call.md +36 -0
- package/skills/ae-generate-tracking-code/references/sdk-index.md +128 -0
- package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +206 -0
- package/skills/ae-generate-tracking-code/references/snippet-delivery.md +394 -0
- package/skills/ae-generate-tracking-code/references/te-api.md +181 -0
- package/skills/ae-generate-tracking-plan/SKILL.md +1083 -0
- package/skills/ae-generate-tracking-plan/references/autotrack-events.md +273 -0
- package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +425 -0
- package/skills/ae-generate-tracking-plan/references/te-api.md +100 -0
- package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +152 -0
- package/skills/ae-kb/SKILL.md +38 -5
- package/tracking-plan-template/MMO/346/211/213/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +104 -0
- package/tracking-plan-template/MMO/346/211/213/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template/MMO/351/241/265/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +117 -0
- package/tracking-plan-template/MMO/351/241/265/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
- package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +72 -0
- package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template/SLG/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +86 -0
- package/tracking-plan-template/SLG/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +80 -0
- package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template/TE /345/237/213/347/202/271/347/244/272/344/276/213/346/250/241/346/235/277.md" +40 -0
- package/tracking-plan-template/TE /345/237/213/347/202/271/347/244/272/344/276/213/346/250/241/346/235/277.xlsx +0 -0
- package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.md +40 -0
- package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.xlsx +0 -0
- package/tracking-plan-template//344/274/221/351/227/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +92 -0
- package/tracking-plan-template//344/274/221/351/227/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
- package/tracking-plan-template//345/215/241/347/211/214/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +119 -0
- package/tracking-plan-template//345/215/241/347/211/214/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//345/241/224/351/230/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_V1.md +130 -0
- package/tracking-plan-template//345/241/224/351/230/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_V1.xlsx +0 -0
- package/tracking-plan-template//345/276/256/344/277/241/345/260/217/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +52 -0
- package/tracking-plan-template//345/276/256/344/277/241/345/260/217/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//346/215/225/351/261/274/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +68 -0
- package/tracking-plan-template//346/215/225/351/261/274/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/215/241/347/211/214/346/270/270/346/210/217_/345/237/213/347/202/271/346/250/241/347/211/210v1.md +108 -0
- package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/215/241/347/211/214/346/270/270/346/210/217_/345/237/213/347/202/271/346/250/241/347/211/210v1.xlsx +0 -0
- package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +119 -0
- package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/346/226/227/345/234/260/344/270/273/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +63 -0
- package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/346/226/227/345/234/260/344/270/273/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/351/272/273/345/260/206/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +101 -0
- package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/351/272/273/345/260/206/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
- package/tracking-plan-template//347/224/265/345/225/206/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.md +84 -0
- package/tracking-plan-template//347/224/265/345/225/206/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//347/237/255/345/211/247/344/272/247/345/223/201/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.md +79 -0
- package/tracking-plan-template//347/237/255/345/211/247/344/272/247/345/223/201/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//347/244/276/344/272/244/350/201/212/345/244/251/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +105 -0
- package/tracking-plan-template//347/244/276/344/272/244/350/201/212/345/244/251/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/tracking-plan-template//351/230/205/350/257/273/347/261/273APP/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +83 -0
- package/tracking-plan-template//351/230/205/350/257/273/347/261/273APP/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- package/wiki/te-docs/index.md +225 -0
- package/wiki/te-docs/raw/advanced-data-type/first-event-check.md +66 -0
- package/wiki/te-docs/raw/advanced-data-type/updated-event.md +87 -0
- package/wiki/te-docs/raw/advanced-data-type.md +16 -0
- package/wiki/te-docs/raw/data-ingestion-guide/about-gdpr.md +55 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/automatic-event-tracking.md +431 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/debugging-and-logging.md +49 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/multi-instance.md +66 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/preset-properties.md +466 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/third-party-integration.md +127 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced.md +513 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/release-notes.md +177 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android.md +228 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/c-advanced.md +419 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c.md +110 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/client-side-sdk-faq.md +52 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/cpp-advanced.md +366 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/release-notes.md +103 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp.md +201 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/compliance.md +26 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/automatically-track-events.md +117 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/preset-properties.md +52 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced.md +267 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/release-notes.md +82 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter.md +139 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/compliance.md +26 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/automatically-track-events.md +121 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/debugging-and-logging.md +54 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/preset-properties.md +18 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced.md +305 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/release-notes.md +79 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native.md +137 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/release-notes.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/automatically-track-events.md +54 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/debugging-and-logging.md +53 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/multi-instance.md +42 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/preset-properties.md +119 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/support-native.md +81 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced.md +331 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app.md +156 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform.md +12 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/automatic-event-tracking.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/multi-instance.md +21 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/preset-properties.md +249 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced.md +301 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/release-notes.md +51 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x.md +281 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/automatic-event-tracking.md +70 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/debugging-and-logging.md +57 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/native-support.md +104 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/preset-properties.md +91 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance.md +374 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/compliance.md +35 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/release-notes.md +109 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator.md +170 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/compliance.md +28 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/automatic-event-tracking.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/debugging-and-logging.md +58 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/preset-properties.md +43 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced.md +204 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/release-notes.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona.md +269 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/release-notes.md +177 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/automatic-event-tracking.md +119 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/multi-instance.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/native-pluggable.md +43 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/preset-properties.md +212 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/third-party-integration.md +77 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced.md +396 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity.md +176 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/release-notes.md +81 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/automatic-event-tracking.md +79 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/debugging-and-logging.md +31 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/preset-properties.md +25 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/third-party-integrations.md +141 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced.md +278 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal.md +190 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine.md +14 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/h5-and-app-sdk-connection.md +147 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/instant-app-and-game.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/automatic-event-tracking.md +272 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/debugging-and-logging.md +77 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/multi-instance.md +142 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/preset-properties.md +484 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/third-party-integrations.md +132 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced.md +682 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/release-notes.md +163 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios.md +304 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/compliance.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/automatic-event-tracking.md +136 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/debugging-and-logging.md +48 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/multi-instance.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/preset-properties.md +132 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced.md +462 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/release-notes.md +107 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript.md +208 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/debugging-and-logging.md +62 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/preset-properties.md +118 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced.md +556 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos.md +231 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk.md +25 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/filebeat-logstash-user-guide.md +610 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/logbus2-user-guide.md +1215 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/ta-datax-writer-plugin-user-guide.md +278 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools.md +15 -0
- package/wiki/te-docs/raw/data-ingestion-guide/privacy-policy.md +38 -0
- package/wiki/te-docs/raw/data-ingestion-guide/restful-api-user-guide.md +155 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-FM9Cwz.md +37 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-RSyfw7.md +41 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging.md +89 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-OxzWw.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-VuE3wr.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-IauKwI.md +175 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-YAilwk.md +210 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced.md +211 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-PVazwa.md +62 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-TADbwY.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes.md +69 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-V2W3wv.md +131 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-Zf9Jwl.md +179 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c.md +189 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/debugging-and-logging.md +38 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced.md +113 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/release-notes.md +34 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang.md +155 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/debugging-and-logging.md +42 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced.md +157 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/release-notes.md +72 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang.md +148 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/debugging-and-logging.md +49 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced.md +223 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/release-notes.md +88 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java.md +174 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/debugging-and-logging.md +46 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced.md +182 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/release-notes.md +61 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua.md +121 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/debugging-and-logging.md +55 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced.md +225 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs.md +141 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/debugging-and-logging.md +41 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced.md +216 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php.md +173 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/debugging-and-logging.md +40 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced.md +206 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/release-notes.md +51 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python.md +116 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/release-notes.md +44 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced.md +189 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby.md +142 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk.md +22 -0
- package/wiki/te-docs/raw/data-ingestion-guide/thinkingdata-privacy-policy.md +37 -0
- package/wiki/te-docs/raw/data-ingestion-guide.md +48 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/data-rules.md +396 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/preset-properties-and-system-fields.md +957 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/user-identification-rules.md +723 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion.md +203 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//345/220/210/350/247/204/346/214/207/345/215/227.md +96 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//346/233/264/346/226/260/346/227/245/345/277/227.md +97 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//345/244/232/345/256/236/344/276/213.md +52 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +48 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +447 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227.md +370 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony.md +172 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//345/220/210/350/247/204/346/214/207/345/215/227.md +37 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//346/233/264/346/226/260/346/227/245/345/277/227.md +209 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//345/244/232/345/256/236/344/276/213.md +71 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +49 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +125 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +498 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227.md +612 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217.md +373 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//345/220/210/350/247/204/346/214/207/345/215/227.md +26 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//346/233/264/346/226/260/346/227/245/345/277/227.md +32 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +48 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +30 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +61 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227.md +236 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua.md +200 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//346/233/264/346/226/260/346/227/245/345/277/227.md +83 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227/native/346/224/257/346/214/201.md +66 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +54 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +62 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +358 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227.md +615 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret.md +166 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//346/233/264/346/226/260/346/227/245/345/277/227.md +87 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227/native/346/224/257/346/214/201.md +71 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +54 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +61 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +406 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227.md +597 -0
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair.md +179 -0
- package/wiki/te-docs/schema.md +16 -0
- package/wiki/te-docs/synthesis/batch-ingest-comparison.md +324 -0
- package/wiki/te-docs/synthesis/js-sdk-cheatsheet.md +538 -0
- package/wiki/te-docs/synthesis/restful-api-reference.md +363 -0
- package/wiki/te-docs/synthesis/sdk-selection.md +372 -0
- package/wiki/te-docs/synthesis/server-sdk-overview.md +449 -0
- package/dist/chunk-U6TKB3IV.js +0 -171
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
---
|
|
2
|
+
topic: JavaScript SDK Cheatsheet
|
|
3
|
+
sources:
|
|
4
|
+
- raw/data-ingestion-guide/client-sdk/javascript.md
|
|
5
|
+
- raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced.md
|
|
6
|
+
- raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/automatic-event-tracking.md
|
|
7
|
+
- raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/preset-properties.md
|
|
8
|
+
generated: 2026-06-16
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The ThinkingData JavaScript SDK (latest version 2.5.1, ~58 KB) runs in browsers and supports IE 9+. It provides automatic, manual, and hybrid event tracking, user identity management, and a rich set of user property APIs. This cheatsheet covers initialization, core tracking APIs, auto-track configuration, super properties, user properties, and preset properties in one place.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. SDK Integration & Initialization
|
|
18
|
+
|
|
19
|
+
### 1.1 NPM (Automatic Integration)
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
npm install thinkingdata-browser --save
|
|
23
|
+
|
|
24
|
+
import ta from "thinkingdata-browser";
|
|
25
|
+
|
|
26
|
+
var config = {
|
|
27
|
+
appId: "APP_ID",
|
|
28
|
+
serverUrl: "https://YOUR_SERVER_URL",
|
|
29
|
+
autoTrack: {
|
|
30
|
+
pageShow: true, // event name: ta_page_show
|
|
31
|
+
pageHide: true, // event name: ta_page_hide
|
|
32
|
+
pageView: true, // SPA page browse, event name: ta_pageview
|
|
33
|
+
pageClick: true // element click, event name: ta_page_click
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
ta.init(config);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 1.2 Script Tag (Manual Integration)
|
|
40
|
+
|
|
41
|
+
**Asynchronous loading** uses `thinkingdata.min.js` and a self-executing bootstrap snippet. Key parameters: `name` (global call variable), `sdkUrl` (script URL), `loaded` (callback after SDK load, fires before any queued data is sent -- ideal for setting user ID).
|
|
42
|
+
|
|
43
|
+
**Synchronous loading** uses `thinkingdata.umd.min.js`:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
<script src="./thinkingdata.umd.min.js"></script>
|
|
47
|
+
<script>
|
|
48
|
+
var config = {
|
|
49
|
+
appId: 'APP_ID',
|
|
50
|
+
serverUrl: 'https://YOUR_SERVER_URL',
|
|
51
|
+
autoTrack: { pageShow: true, pageHide: true }
|
|
52
|
+
};
|
|
53
|
+
window.ta = thinkingdata;
|
|
54
|
+
ta.init(config);
|
|
55
|
+
</script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 1.3 Init Config Options Reference
|
|
59
|
+
|
|
60
|
+
| Config Key | Type | Default | Description |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| `appId` | string | required | Your project APP ID from the TE management page |
|
|
63
|
+
| `serverUrl` | string | required | Receiver URL (SaaS) or custom tracking URL (private deployment) |
|
|
64
|
+
| `autoTrack` | object | `{}` | Auto-track switches (see Section 4) |
|
|
65
|
+
| `send_method` | string | - | `'ajax'` for batch sending |
|
|
66
|
+
| `batch` | bool/object | `false` | Enable batch sending, or `{size, interval, storageLimit}` |
|
|
67
|
+
| `zoneOffset` | number | local | Default timezone offset in hours (e.g., `8` for UTC+8) |
|
|
68
|
+
| `disableRConfig` | bool | `false` | Set `true` to prevent SDK from pulling remote config at init |
|
|
69
|
+
| `secretKey` | object | - | Encryption: `{publicKey, version}` (requires crypto-js + jsencrypt) |
|
|
70
|
+
|
|
71
|
+
### 1.4 Batch Sending
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
var config = {
|
|
75
|
+
appId: 'xxx',
|
|
76
|
+
serverUrl: 'xxx',
|
|
77
|
+
send_method: 'ajax',
|
|
78
|
+
batch: {
|
|
79
|
+
size: 5, // max per batch send, default 5, min 1, max 30
|
|
80
|
+
interval: 5000, // send interval in ms, default 6000
|
|
81
|
+
storageLimit: 200 // max locally cached items, default 200
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Notes:** Batch sending cannot be used with callbacks or `app_js_bridge`. Data in `debug`/`debugOnly` mode is sent directly regardless.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 2. User Identity Management
|
|
91
|
+
|
|
92
|
+
The SDK generates a random UUID as the default distinct ID. Call `login` after the user authenticates to associate events with an account.
|
|
93
|
+
|
|
94
|
+
| API | Description |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `ta.getDistinctId()` | Returns the current distinct ID |
|
|
97
|
+
| `ta.getDeviceId()` | Returns the device ID |
|
|
98
|
+
| `ta.identify("custom_id")` | Overrides the default distinct ID with your own system's ID |
|
|
99
|
+
| `ta.login("account_id")` | Associates events with a user account (sets `#account_id`) |
|
|
100
|
+
| `ta.logout()` | Removes account ID, reverts to distinct ID |
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
// Set a custom distinct ID immediately after init
|
|
104
|
+
ta.identify("Thinker");
|
|
105
|
+
|
|
106
|
+
// When user logs in
|
|
107
|
+
ta.login("user_12345");
|
|
108
|
+
|
|
109
|
+
// When user explicitly logs out
|
|
110
|
+
ta.logout();
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 3. Event Tracking APIs
|
|
116
|
+
|
|
117
|
+
### 3.1 Ordinary Events (`track`)
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
ta.track("product_buy", { product_name: "tv" });
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Event name: string, starts with a letter, max 50 chars, supports letters / digits / underscore `_`.
|
|
124
|
+
|
|
125
|
+
### 3.2 Event-Type Comparison
|
|
126
|
+
|
|
127
|
+
| Type | API | Behavior | Use Case |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| Ordinary | `ta.track(name, props)` | Fires every time | Most user actions |
|
|
130
|
+
| First Event | `ta.trackFirst({eventName, properties, firstCheckId?})` | Recorded only once per device/ID | Device activation, first purchase |
|
|
131
|
+
| Updatable Event | `ta.trackUpdate({eventName, properties, eventId})` | Merges new properties into existing event by `eventId` | Order status updates |
|
|
132
|
+
| Overwriteable Event | `ta.trackOverwrite({eventName, properties, eventId})` | Replaces entire event data by `eventId` | Full data replacement |
|
|
133
|
+
|
|
134
|
+
**First Event Example:**
|
|
135
|
+
|
|
136
|
+
```javascript
|
|
137
|
+
// Once per device
|
|
138
|
+
ta.trackFirst({
|
|
139
|
+
eventName: "device_activation",
|
|
140
|
+
properties: { key: "value" }
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Once per custom dimension (e.g., user account)
|
|
144
|
+
ta.trackFirst({
|
|
145
|
+
eventName: "account_activation",
|
|
146
|
+
firstCheckId: "TA",
|
|
147
|
+
properties: { key: "value" }
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
> First events are stored ~1 hour later due to server-side deduplication checks.
|
|
152
|
+
|
|
153
|
+
**Updatable Event Example:**
|
|
154
|
+
|
|
155
|
+
```javascript
|
|
156
|
+
ta.trackUpdate({
|
|
157
|
+
eventName: "UPDATABLE_EVENT",
|
|
158
|
+
properties: { status: 3, price: 100 },
|
|
159
|
+
eventId: "test_event_id"
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Later: only status changes, price is preserved
|
|
163
|
+
ta.trackUpdate({
|
|
164
|
+
eventName: "UPDATABLE_EVENT",
|
|
165
|
+
properties: { status: 5 },
|
|
166
|
+
eventId: "test_event_id"
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Overwriteable Event Example:**
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
ta.trackOverwrite({
|
|
174
|
+
eventName: "OVERWRITE_EVENT",
|
|
175
|
+
properties: { status: 3, price: 100 },
|
|
176
|
+
eventId: "test_event_id"
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Later: all previous properties are replaced
|
|
180
|
+
ta.trackOverwrite({
|
|
181
|
+
eventName: "OVERWRITE_EVENT",
|
|
182
|
+
properties: { status: 5 },
|
|
183
|
+
eventId: "test_event_id"
|
|
184
|
+
});
|
|
185
|
+
// price is now deleted
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 3.3 Timing Events
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
// Start timing
|
|
192
|
+
ta.timeEvent("stay_shop");
|
|
193
|
+
|
|
194
|
+
// ... user browses the product page ...
|
|
195
|
+
|
|
196
|
+
// End timing -- #duration (seconds) is automatically appended
|
|
197
|
+
ta.track("stay_shop", { product_name: "product_name" });
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Only one timer per event name can run at a time.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 4. Auto-Track Configuration
|
|
205
|
+
|
|
206
|
+
All auto-track settings go under the `autoTrack` key in the init config object.
|
|
207
|
+
|
|
208
|
+
| Setting | Type | Event Name | Description | Since |
|
|
209
|
+
|---|---|---|---|---|
|
|
210
|
+
| `pageShow` | bool | `ta_page_show` | Page display event | v1.x |
|
|
211
|
+
| `pageHide` | bool | `ta_page_hide` | Page hide event (includes `#duration`) | v1.x |
|
|
212
|
+
| `pageView` | bool | `ta_pageview` | SPA route-change browse event | v2.4.0 |
|
|
213
|
+
| `pageClick` | bool | `ta_page_click` | Element click event | v2.5.0 |
|
|
214
|
+
|
|
215
|
+
### 4.1 Full Auto-Track Example with Custom Properties
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
var config = {
|
|
219
|
+
appId: 'xxx',
|
|
220
|
+
serverUrl: 'xxx',
|
|
221
|
+
autoTrack: {
|
|
222
|
+
pageShow: true,
|
|
223
|
+
pageHide: true,
|
|
224
|
+
pageView: true,
|
|
225
|
+
pageClick: true,
|
|
226
|
+
properties: {
|
|
227
|
+
staticKey: 'staticValue'
|
|
228
|
+
},
|
|
229
|
+
callback: (eventType) => {
|
|
230
|
+
if (eventType === 'pageShow') {
|
|
231
|
+
return { appShowKey: 'appShowValue' };
|
|
232
|
+
} else if (eventType === 'pageHide') {
|
|
233
|
+
return { appHideKey: 'appHideValue' };
|
|
234
|
+
} else if (eventType === 'pageView') {
|
|
235
|
+
return { pageViewKey: 'pageViewValue' };
|
|
236
|
+
}
|
|
237
|
+
return {};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- `properties`: static properties added to every auto-track event.
|
|
244
|
+
- `callback(eventType)`: returns dynamic properties per auto-track event type.
|
|
245
|
+
|
|
246
|
+
### 4.2 Page Click Details
|
|
247
|
+
|
|
248
|
+
When `pageClick: true`, the SDK collects clicks on elements with `onclick` or `td-track-id`:
|
|
249
|
+
|
|
250
|
+
```html
|
|
251
|
+
<button onclick="testFun()" td-track-id="buttonId">test button</button>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
The `#element_id` property is automatically added with the value of `td-track-id`. The element identifier is resolved in this priority order:
|
|
255
|
+
|
|
256
|
+
1. Custom attribute `td-track-id`
|
|
257
|
+
2. Element `innerHTML`
|
|
258
|
+
3. Element `value`
|
|
259
|
+
4. Fallback: `"ID not obtained"`
|
|
260
|
+
|
|
261
|
+
**Ignore click on an element:**
|
|
262
|
+
|
|
263
|
+
```html
|
|
264
|
+
<!-- Standard HTML -->
|
|
265
|
+
<button onclick="testFun()" td-track-ignore>test button</button>
|
|
266
|
+
<!-- React: must use td-track-ignore="true" -->
|
|
267
|
+
<button onClick={testFun} td-track-ignore="true">test button</button>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
> Vue projects: elements lack `onclick` -- use `td-track-id` exclusively for click filtering.
|
|
271
|
+
|
|
272
|
+
### 4.3 Manual Element Click Tracking (`trackLink`)
|
|
273
|
+
|
|
274
|
+
For finer control, use `trackLink` to attach listeners to specific elements:
|
|
275
|
+
|
|
276
|
+
```javascript
|
|
277
|
+
ta.trackLink(
|
|
278
|
+
{ tag: ["a", "button"], class: ["class1"], id: ["id1"] },
|
|
279
|
+
"click_event_name",
|
|
280
|
+
{ production: "production", name: "name" }
|
|
281
|
+
);
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
> `trackLink` sets listeners once. New elements added after the call are not monitored -- call `trackLink` again for them.
|
|
285
|
+
|
|
286
|
+
### 4.4 Manual Page Browsing (`quick("autoTrack")`)
|
|
287
|
+
|
|
288
|
+
```javascript
|
|
289
|
+
// Report a page view immediately
|
|
290
|
+
ta.quick("autoTrack");
|
|
291
|
+
|
|
292
|
+
// With custom properties
|
|
293
|
+
ta.quick('autoTrack', {
|
|
294
|
+
name: 'test_name',
|
|
295
|
+
time: new Date(),
|
|
296
|
+
pro: [1, 2, 3, 4]
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 5. Super Properties
|
|
303
|
+
|
|
304
|
+
Super properties are automatically appended to every event. There are three tiers with different priorities and caching behavior.
|
|
305
|
+
|
|
306
|
+
| Type | API | Priority | Persistence | Value Type |
|
|
307
|
+
|---|---|---|---|---|
|
|
308
|
+
| Page Public Properties | `ta.setPageProperty(props)` | Highest | Current page only | Static only |
|
|
309
|
+
| Dynamic Super Properties | `ta.setDynamicSuperProperties(fn)` | Medium | Cleared on re-init | Dynamic (function return) |
|
|
310
|
+
| Static Super Properties | `ta.setSuperProperties(props)` | Lowest | localStorage/cookie | Static only |
|
|
311
|
+
|
|
312
|
+
### 5.1 Static Super Properties
|
|
313
|
+
|
|
314
|
+
```javascript
|
|
315
|
+
// Set
|
|
316
|
+
ta.setSuperProperties({ vip_level: 2, channel: "te" });
|
|
317
|
+
|
|
318
|
+
// Get all
|
|
319
|
+
var sp = ta.getSuperProperties();
|
|
320
|
+
|
|
321
|
+
// Remove one
|
|
322
|
+
ta.unsetSuperProperty("channel");
|
|
323
|
+
|
|
324
|
+
// Remove all
|
|
325
|
+
ta.clearSuperProperties();
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### 5.2 Page Public Properties
|
|
329
|
+
|
|
330
|
+
```javascript
|
|
331
|
+
ta.setPageProperty({ page_id: "page10001" });
|
|
332
|
+
|
|
333
|
+
// Get current page's public properties
|
|
334
|
+
var pp = ta.getPageProperty();
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### 5.3 Dynamic Super Properties
|
|
338
|
+
|
|
339
|
+
```javascript
|
|
340
|
+
ta.setDynamicSuperProperties(function() {
|
|
341
|
+
var d = new Date();
|
|
342
|
+
d.setHours(10);
|
|
343
|
+
return { date: d };
|
|
344
|
+
});
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
The callback is invoked at every `track` call, and its return value is merged into the event properties.
|
|
348
|
+
|
|
349
|
+
### 5.4 Property Value Types
|
|
350
|
+
|
|
351
|
+
Super properties (and all event/user properties) support:
|
|
352
|
+
|
|
353
|
+
- `string`, `number`, `boolean`
|
|
354
|
+
- `Date` (converts to time)
|
|
355
|
+
- `object` (flat key-value)
|
|
356
|
+
- `array` (e.g., `["value"]`)
|
|
357
|
+
- `array of objects` (e.g., `[{key: "value"}]`)
|
|
358
|
+
|
|
359
|
+
Key rules: starts with a letter, contains letters/digits/underscores only, max 50 characters, case-insensitive (uppercase is converted to lowercase by TE).
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## 6. User Properties API Reference
|
|
364
|
+
|
|
365
|
+
| API | Behavior | Example |
|
|
366
|
+
|---|---|---|
|
|
367
|
+
| `userSet(props)` | Sets properties, overwrites existing | `ta.userSet({ username: "TA" })` |
|
|
368
|
+
| `userSetOnce(props)` | Sets once, ignores subsequent calls | `ta.userSetOnce({ first_payment_time: "2018-01-01" })` |
|
|
369
|
+
| `userAdd(props)` | Adds to numeric properties (negative = subtract) | `ta.userAdd({ total_revenue: 30 })` |
|
|
370
|
+
| `userUnset("key")` | Resets a single property | `ta.userUnset("userPropertykey")` |
|
|
371
|
+
| `userDelete()` | Deletes the user (events remain queryable) | `ta.userDelete()` |
|
|
372
|
+
| `userAppend(props)` | Appends to array properties (allows duplicates) | `ta.userAppend({ user_list: ["a", "b"] })` |
|
|
373
|
+
| `userUniqAppend(props)` | Appends to array properties (deduplicated) | `ta.userUniqAppend({ user_list: ["a", "c"] })` |
|
|
374
|
+
|
|
375
|
+
```javascript
|
|
376
|
+
// userSet overwrites
|
|
377
|
+
ta.userSet({ username: "TA" }); // username = "TA"
|
|
378
|
+
ta.userSet({ username: "TE" }); // username = "TE"
|
|
379
|
+
|
|
380
|
+
// userSetOnce: first write wins
|
|
381
|
+
ta.userSetOnce({ first_payment_time: "2018-01-01" });
|
|
382
|
+
ta.userSetOnce({ first_payment_time: "2018-12-31" }); // ignored
|
|
383
|
+
|
|
384
|
+
// userAdd accumulates
|
|
385
|
+
ta.userAdd({ total_revenue: 30 }); // total_revenue = 30
|
|
386
|
+
ta.userAdd({ total_revenue: 648 }); // total_revenue = 678
|
|
387
|
+
|
|
388
|
+
// userAppend vs userUniqAppend
|
|
389
|
+
ta.userAppend({ user_list: ["apple", "ball"] }); // ["apple", "ball"]
|
|
390
|
+
ta.userAppend({ user_list: ["apple", "cube"] }); // ["apple", "ball", "apple", "cube"]
|
|
391
|
+
ta.userUniqAppend({ user_list: ["apple", "cube"] }); // ["apple", "ball", "cube"]
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 7. Preset Properties
|
|
397
|
+
|
|
398
|
+
### 7.1 All Events
|
|
399
|
+
|
|
400
|
+
Every event (including auto-track events) carries these preset properties:
|
|
401
|
+
|
|
402
|
+
| Property | Display Name | Type | Description |
|
|
403
|
+
|---|---|---|---|
|
|
404
|
+
| `#os` | OS | Text | Operating system (e.g., "Mac OS X") |
|
|
405
|
+
| `#screen_width` | Screen Width | Number | Screen width in pixels |
|
|
406
|
+
| `#screen_height` | Screen Height | Number | Screen height in pixels |
|
|
407
|
+
| `#browser` | Browser | Text | Browser type (e.g., "Chrome") |
|
|
408
|
+
| `#browser_version` | Browser Version | Text | Browser version |
|
|
409
|
+
| `#device_id` | Device ID | Text | Device identifier |
|
|
410
|
+
| `#zone_offset` | Timezone Offset | Number | UTC offset in hours |
|
|
411
|
+
|
|
412
|
+
### 7.2 Auto-Track Events Only
|
|
413
|
+
|
|
414
|
+
These additional preset properties are added to auto-track events (`ta_page_show`, `ta_page_hide`, `ta_pageview`, `ta_page_click`):
|
|
415
|
+
|
|
416
|
+
| Property | Description |
|
|
417
|
+
|---|---|
|
|
418
|
+
| `#url` | Current full URL of the page |
|
|
419
|
+
| `#url_path` | Current URL path |
|
|
420
|
+
| `#referrer` | Referrer URL (previous page address) |
|
|
421
|
+
| `#referrer_host` | Referrer hostname |
|
|
422
|
+
| `#title` | Current page title |
|
|
423
|
+
|
|
424
|
+
### 7.3 Retrieving Preset Properties Programmatically
|
|
425
|
+
|
|
426
|
+
```javascript
|
|
427
|
+
var presetProperties = ta.getPresetProperties();
|
|
428
|
+
|
|
429
|
+
// All preset properties as an event property object
|
|
430
|
+
var props = presetProperties.toEventPresetProperties();
|
|
431
|
+
/*
|
|
432
|
+
{
|
|
433
|
+
"#os": "Mac OS X",
|
|
434
|
+
"#screen_width": 1920,
|
|
435
|
+
"#screen_height": 1080,
|
|
436
|
+
"#browser": "Chrome",
|
|
437
|
+
"#browser_version": "91.0.4472.114",
|
|
438
|
+
"#device_id": "17a3858fafd9b4-...",
|
|
439
|
+
"#zone_offset": 8
|
|
440
|
+
}
|
|
441
|
+
*/
|
|
442
|
+
|
|
443
|
+
// Individual access
|
|
444
|
+
var os = presetProperties.os;
|
|
445
|
+
var screenWidth = presetProperties.screenWidth;
|
|
446
|
+
var screenHeight = presetProperties.screenHeight;
|
|
447
|
+
var browser = presetProperties.browser;
|
|
448
|
+
var browserVersion = presetProperties.browserVersion;
|
|
449
|
+
var deviceId = presetProperties.deviceId;
|
|
450
|
+
var zoneOffset = presetProperties.zoneOffset;
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Use this when server-side data tracking needs client-side preset properties.
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## 8. Advanced Features
|
|
458
|
+
|
|
459
|
+
### 8.1 Cross-Domain Tracking (`siteLinker`)
|
|
460
|
+
|
|
461
|
+
Unify user identity across two different domains:
|
|
462
|
+
|
|
463
|
+
```javascript
|
|
464
|
+
ta.quick('siteLinker', {
|
|
465
|
+
linker: [
|
|
466
|
+
{ part_url: 'thinkingdata.cn', after_hash: true },
|
|
467
|
+
{ part_url: 'example.com', after_hash: true }
|
|
468
|
+
]
|
|
469
|
+
});
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
- `part_url`: substring of the target domain URL
|
|
473
|
+
- `after_hash`: `true` appends `_tasdk` parameter to the hash fragment; `false` appends to the query string
|
|
474
|
+
|
|
475
|
+
### 8.2 Encryption
|
|
476
|
+
|
|
477
|
+
```javascript
|
|
478
|
+
var config = {
|
|
479
|
+
appId: "xxx",
|
|
480
|
+
serverUrl: "xxx",
|
|
481
|
+
secretKey: {
|
|
482
|
+
publicKey: 'public_key_from_te_admin',
|
|
483
|
+
version: 1
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Requires additional dependencies:
|
|
489
|
+
```html
|
|
490
|
+
<script src="https://cdn.bootcdn.net/ajax/libs/crypto-js/4.1.1/crypto-js.js"></script>
|
|
491
|
+
<script src="https://cdn.bootcss.com/jsencrypt/3.2.1/jsencrypt.js"></script>
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### 8.3 Default Timezone
|
|
495
|
+
|
|
496
|
+
```javascript
|
|
497
|
+
var config = {
|
|
498
|
+
appId: "xxx",
|
|
499
|
+
serverUrl: "xxx",
|
|
500
|
+
zoneOffset: 8 // UTC+8; omit to use device local time
|
|
501
|
+
};
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
> When a fixed timezone is set, the device's local timezone information is lost in the event. Add a custom property if you need to preserve it.
|
|
505
|
+
|
|
506
|
+
### 8.4 Best-Practice Initialization Order
|
|
507
|
+
|
|
508
|
+
```javascript
|
|
509
|
+
import ta from "thinkingdata-browser";
|
|
510
|
+
var config = {
|
|
511
|
+
appId: "APP_ID",
|
|
512
|
+
serverUrl: "https://YOUR_SERVER_URL",
|
|
513
|
+
autoTrack: {
|
|
514
|
+
pageShow: true,
|
|
515
|
+
pageHide: true,
|
|
516
|
+
pageView: true,
|
|
517
|
+
pageClick: true
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
// 1. Initialize SDK
|
|
522
|
+
ta.init(config);
|
|
523
|
+
|
|
524
|
+
// 2. Set user account if logged in
|
|
525
|
+
ta.login("TA");
|
|
526
|
+
|
|
527
|
+
// 3. Set super properties before sending any events
|
|
528
|
+
ta.setSuperProperties({
|
|
529
|
+
channel: "ta",
|
|
530
|
+
vip_level: 2
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
// 4. Track events
|
|
534
|
+
ta.track("product_buy", { product_name: "tv" });
|
|
535
|
+
|
|
536
|
+
// 5. Set user properties
|
|
537
|
+
ta.userSet({ username: "TA" });
|
|
538
|
+
```
|