-
Notifications
You must be signed in to change notification settings - Fork 0
IntimateMerger Analytics Adapter : initial release #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Tread carefully! This PR adds 1 linter error (possibly disabled through directives):
|
|
Tread carefully! This PR adds 1 linter error (possibly disabled through directives):
|
|
Tread carefully! This PR adds 1 linter error (possibly disabled through directives):
|
fecker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちともろもろ確認したいのと、意識合わせしたいです。
各社のAnalytics Adaptor は、bid の分析をもろもろしているのですが、
IMでは不要なので、そのあたりは調整が必要かなと。
今の実装ならキャッシュは不要な気がしつつ、バッファリング送信機能をつけるなら必要になるかなと思っています。
- AUCTION_INIT
- cache の初期化(auctionId の管理用)
- Consent データの初期化 (auctionId に紐づけて管理)
- pvデータのみを送信(ちょっと悩み中。データとして使わないなら、ぶっちゃけまとめて送ってもいいかも? 調整中)
- AUCTION_END
- setTimeout で遅延実行(800 ms くらい?)
- cache[auctionId] に入ってるものを送る
- cache[auctionId] で、データ送信フラグ を管理
- setTimeout で遅延実行(3分後くらい?)
- cache[auctionId] を削除する
− SPA でたまらないようにする
- cache[auctionId] を削除する
- setTimeout で遅延実行(800 ms くらい?)
- BID_WON
- cache[auctionId] に 情報を蓄積する
- データ送信済だったら(フラグがたってたら)全データを再送する
実装イメージ
case EVENTS.AUCTION_END:
setTimeout(() => {
analyticsAdapter.sendEvents(args.auctionId);
}, BID_WON_WAIT); // 800ms ?
break;
こんなことを書いてる Adaptor がいるので、バッファリングいけるんじゃないかと思ってます。
case EVENTS.BID_WON:
const auction = cache.auctions[args.auctionId];
if (!auction) return;
// transactionId 単位で、cache するか
// 配列に push した方が楽かもしれない
// 再送を考えて、Timestamp も入れてもいいかも
if (auction.sendStatus & REQUEST_SENT) { // すでに送信済だったら
analyticsAdapter.sendEvents(args.auctionId); // 再送する
}
みたいな感じでいけたりしないかなぁと思ってきました。
許諾のデータは、
libraries/intentIqUtils/getCmpData.js を参考にして
gdpr と usp (ccpa) だけとっておくと幸せになれるかなとおもってきました。
import { allConsent } from '../../src/consentHandler.js';
/**
* Retrieves consent data from the Consent Management Platform (CMP).
* @return {Object} An object containing the following fields:
* - `gdprString` (string): GDPR consent string if available.
* - `uspString` (string): USP consent string if available.
* - `gppString` (string): GPP consent string if available.
*/
export function getCmpData() {
const consentData = allConsent.getConsentData();
return {
gdprApplies: consentData?.gdpr?.gdprApplies || false,
gdprString: typeof consentData?.gdpr?.consentString === 'string' ? consentData.gdpr.consentString : null,
uspString: typeof consentData?.usp === 'string' ? consentData.usp : null,
gppString: typeof consentData?.gpp?.gppString === 'string' ? consentData.gpp.gppString : null,
};
}
|
|
Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):
|
|
Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):
|
|
Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):
|
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Other information