Skip to content
Snippets Groups Projects
Unverified Commit 9f706d54 authored by Nicolò Pretto's avatar Nicolò Pretto Committed by GitHub
Browse files

rename event -> simple_event and trackEvent -> trackSimpleEvent (#47608)


* rename event -> simple_event and trackEvent -> trackSimpleEvent

* add empty line at the end of the file

Co-authored-by: default avatarThomas Schmidt <thomas@metabase.com>

---------

Co-authored-by: default avatarThomas Schmidt <thomas@metabase.com>
parent 7287a346
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ export type SchemaEventMap = {
embed_flow: EmbedFlowEvent;
embed_share: EmbedShareEvent;
embedding_homepage: EmbeddingHomepageEvent;
event: SimpleEvent;
simple_event: SimpleEvent;
invite: InviteEvent;
metabot: MetabotEvent;
model: ModelEvent;
......
......@@ -22,7 +22,7 @@ const VERSIONS: Record<SchemaType, string> = {
embed_flow: "1-0-2",
embed_share: "1-0-0",
embedding_homepage: "1-0-0",
event: "1-0-0",
simple_event: "1-0-0",
invite: "1-0-1",
metabot: "1-0-1",
model: "1-0-0",
......@@ -35,8 +35,8 @@ const VERSIONS: Record<SchemaType, string> = {
upsell: "1-0-0",
};
export function trackEvent(event: SimpleEvent) {
trackSchemaEvent("event", event);
export function trackSimpleEvent(event: SimpleEvent) {
trackSchemaEvent("simple_event", event);
}
export function trackSchemaEvent(schema: SchemaType, event: SchemaEvent): void {
......
import { trackEvent } from "metabase/lib/analytics";
import { trackSimpleEvent } from "metabase/lib/analytics";
export const trackButtonClicked = () => {
trackEvent({
trackSimpleEvent({
event: "csv_upload_clicked",
triggered_from: "left_nav",
});
......
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Generic event to track interactions and actions that happen within Metabase. This should be used as a default schema for tracking events. If more specific context is needed, we can use custom context entities (https://docs.snowplow.io/docs/understanding-your-pipeline/entities/).",
"self": {
"vendor": "com.metabase",
"name": "event",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"event": {
"description": "Name of the action. Noun (target) + Verb in the past (action) which define the action taken - e.g. question_created, dashboard_updated, dashboard_auto_apply_filter_enabled",
"type": "string",
"maxLength": 1024
},
"target_id": {
"description": "(Optional) ID of the entity that the action was performed on. E.g. the ID of the question that was created in a question_created event.",
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 2147483647
},
"triggered_from": {
"description": "(Optional) From where the action was taken/triggered. This can be generic like 'dashboard' or also more specific like 'dashboard_top_nav'.",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"duration_ms": {
"description": "(Optional) Duration in milliseconds",
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 2147483647
},
"result": {
"description": "(Optional) The outcome of the action (e.g. success, failure, …)",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"event_detail": {
"description": "(Optional) String that can be used for additional details that describe the event, e.g. the type of question that was created in a question_created event. We should NOT pass JSON here.",
"type": [
"string",
"null"
],
"maxLength": 1024
}
},
"required": [
"event"
],
"additionalProperties": true
}
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Generic event to track interactions and actions that happen within Metabase. This should be used as a default schema for tracking events. If more specific context is needed, we can use custom context entities (https://docs.snowplow.io/docs/understanding-your-pipeline/entities/).",
"self": {
"vendor": "com.metabase",
"name": "simple_event",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"event": {
"description": "Name of the action. Noun (target) + Verb in the past (action) which define the action taken - e.g. question_created, dashboard_updated, dashboard_auto_apply_filter_enabled",
"type": "string",
"maxLength": 1024
},
"target_id": {
"description": "(Optional) ID of the entity that the action was performed on. E.g. the ID of the question that was created in a question_created event.",
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 2147483647
},
"triggered_from": {
"description": "(Optional) From where the action was taken/triggered. This can be generic like 'dashboard' or also more specific like 'dashboard_top_nav'.",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"duration_ms": {
"description": "(Optional) Duration in milliseconds",
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 2147483647
},
"result": {
"description": "(Optional) The outcome of the action (e.g. success, failure, …)",
"type": [
"string",
"null"
],
"maxLength": 1024
},
"event_detail": {
"description": "(Optional) String that can be used for additional details that describe the event, e.g. the type of question that was created in a question_created event. We should NOT pass JSON here.",
"type": [
"string",
"null"
],
"maxLength": 1024
}
},
"required": [
"event"
],
"additionalProperties": true
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment