1.3.2 • Published 2 years ago
@dcardsdk/web-ad-tracking-sdk v1.3.2
The advertising tracking SDK for web environments powered by Dcard Inc.
🏠 Homepage
Install & Usage
Integrate tracking SDK into your codebase (Support typing automatically in IDE like vscode)
- Install @dcardsdk/web-ad-tracking-sdk
yarn add @dcardsdk/web-ad-tracking-sdk
- Import @dcardsdk/web-ad-tracking-sdk
import entry from '@dcardsdk/web-ad-tracking-sdk'
// Substitute the real client ID for CLIENT_ID issued by Dcard.
entry('init', 'CLIENT_ID');
entry('track', 'PageView', { url: window.location.href });
OR embed the SDK in the HTML file
- Copy and paste the following script tag into the HTML file to initialize the web tracking SDK.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Embedding SDK example</title>
<script>!function(){const d=function(n,...e){d.queue.push([n,...e])};d.queue=[],window.dadk=window.dadk||d;const n=document.createElement("script");n.src="https://unpkg.com/@dcardsdk/web-ad-tracking-sdk",document.head.append(n),window.dadk("init","CLIENT_ID"),window.dadk("track","PageView",{url:window.location.href})}();
</script>
</head>
<body></body>
</html>
- Fetch the latest type declaration file
curl -Ls "public-ts-declaration-url" -o types/dadk.d.ts
- Place the following triple-slash directive to enable typing system in JS files(It must be the first line of the file).
/// <reference path="types/dadk.d.ts" />
// Assume the types folder is at the same level as this script.
window.dadk('track', 'AddToCart', { 'contents': { test: '123' } })
Interface
https://unpkg.com/@dcardsdk/web-ad-tracking-sdk/build/types/index.d.ts
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
2.4.1
1 year ago
2.4.0
1 year ago
2.4.3
1 year ago
2.4.2
1 year ago
1.3.2
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
1.0.0-first-version.8
3 years ago
1.0.0-first-version.7
3 years ago
1.0.0-first-version.6
3 years ago
1.0.0-first-version.5
3 years ago
1.0.0-first-version.4
3 years ago
1.0.0-first-version.3
3 years ago