Skip to content

Commit 0c1dfb9

Browse files
committed
Draft a schema file for our banner events
This file will be modified and moved into the official schema repo, this is just a draft and we need to clarify some things Ticket: https://phabricator.wikimedia.org/T336842
1 parent b863d6d commit 0c1dfb9

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

docs/schema_example.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#TODO ask PM about title (path) and ID
2+
#TODO Ask PM about $ref
3+
title: TBD
4+
description: Logs banner events for WMDE fundraising campaigns
5+
$id: TBD
6+
$schema: 'https://json-schema.org/draft-07/schema#'
7+
type: object
8+
9+
properties:
10+
event:
11+
type: object
12+
required:
13+
- eventName
14+
- trackingKeyword
15+
properties:
16+
trackingKeyword:
17+
description: tracking keyword for the banner this (eventName) event came from
18+
type: string
19+
eventName:
20+
description: the name of the event
21+
type: string
22+
feature:
23+
description: >
24+
Which part of the banner the event comes from.
25+
Can be a Component name or a general feature description like "SoftClose".
26+
Can be empty, if exact source is not needed (defined by Campaigns Team)
27+
type: string
28+
userChoice:
29+
description: >
30+
For tracking the same event where the user has a choice between several options or specific actions.
31+
ONLY use this for tracking predefined user interactions.
32+
Examples: 'increase' or 'decrease' (custom amount), 'recurring' or 'non-recurring' ("upgrade to yearly" form)
33+
type: string
34+
customData:
35+
description: >
36+
Event-specific structured data
37+
Example: Viewport data (banner height, screen width and height) for size issues
38+
type: object
39+
additionalProperties: {type: "string"}
40+
41+
examples:
42+
- event:
43+
trackingKeyword: org-25-231227-ctrl
44+
eventName: not-shown
45+
feature: Page
46+
customData:
47+
bannerHeight: 200px
48+
49+
meta:
50+
dt: '2020-04-02T19:11:20.942Z'
51+
id: b0caf18d-6c7f-4403-947d-2712bbe28610
52+
stream: eventlogging_WMDEBannerEvents
53+
dt: '2020-04-02T19:11:20.942Z'
54+
client_dt: '2020-04-02T19:11:20.942Z'
55+
$schema:
56+
$ref: '#/$id'
57+
# schema: WMDEBannerEvents
58+
- event:
59+
trackingKeyword: org-mob11_2-231201-var
60+
eventName: upgrade-to-yearly
61+
feature: UpgradeToYearly
62+
userChoice: recurring
63+
64+
meta:
65+
dt: '2020-04-02T19:11:20.942Z'
66+
id: b0caf18d-6c7f-4403-947d-2712bbe28610
67+
stream: eventlogging_WMDEBannerEvents
68+
dt: '2020-04-02T19:11:20.942Z'
69+
client_dt: '2020-04-02T19:11:20.942Z'
70+
$schema:
71+
$ref: '#/$id'
72+
# schema: WMDEBannerEvents

0 commit comments

Comments
 (0)