This commit is contained in:
38
examples/simple-js/example.html
Normal file
38
examples/simple-js/example.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Aptabase Standalone Example</title>
|
||||
<!-- <script src="https://static.hmac.kr/aptabase.min.js"></script> -->
|
||||
<!-- <script src="./packages/web/dist/aptabase.min.js"></script> -->
|
||||
<script src="./aptabase.min.js"></script>
|
||||
<style>
|
||||
body { font-family: sans-serif; padding: 2em; }
|
||||
button { display: block; margin-bottom: 1em; padding: 0.5em 1em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Aptabase Standalone 테스트</h1>
|
||||
<p>Click the buttons below to send test events.</p>
|
||||
|
||||
<button onclick="track('app_started')">Track: App Started</button>
|
||||
<button onclick="track('feature_a_used', { plan: 'premium' })">Track: Used Feature A (with props)</button>
|
||||
<button onclick="track('feature_b_used')">Track: Used Feature B</button>
|
||||
<button onclick="track('user_signed_up')">Track: User Signed Up</button>
|
||||
<button onclick="track('item_purchased', { item_id: 'SKU-123', price: 9.99 })">Track: Item Purchased (with props)</button>
|
||||
|
||||
<script>
|
||||
// 1. Aptabase 초기화
|
||||
// App Key의 region이 'SH'인 경우 host는 필수입니다.
|
||||
window.aptabase.init("A-SH-7212023630", {
|
||||
host: "https://aptabase.hmac.kr"
|
||||
});
|
||||
|
||||
function track(eventName, props) {
|
||||
// 2. 이벤트 전송
|
||||
window.aptabase.trackEvent(eventName, props);
|
||||
console.log(`Event '${eventName}' sent!`, props ? { props } : '');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user