From d210aeec16e341eb9713e3e79a5162759ff1d48a Mon Sep 17 00:00:00 2001 From: freddyDOTCMS Date: Fri, 17 Jan 2025 09:16:49 -0600 Subject: [PATCH 1/4] Enabling events scope in CA --- .../setup/config/dev/cube/schema/Events.js | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js index 179e6b7e72c..d79c0bad55b 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js @@ -268,3 +268,75 @@ cube('request', { } }); +cube('events', { + sql: `select * from events`, + dimensions: { + conHost: { sql: 'conHost', type: `string` }, + conHostName: { sql: 'conHostName', type: `string` }, + contentTypeName: { sql: 'contentTypeName', type: `string` }, + contentTypeId: { sql: 'contentTypeId', type: `string` }, + contentTypeVariable: { sql: 'contentType', type: `string` }, + live: { sql: 'live', type: `boolean` }, + working: { sql: 'working', type: `boolean` }, + baseType: { sql: 'baseType', type: `string` }, + identifier: { sql: 'identifier', type: `string` }, + title: { sql: 'title', type: `string` }, + requestId: { sql: 'request_id', type: `string` }, + clusterId: { sql: 'cluster_id', type: `string` }, + customerId: { sql: 'customer_id', type: `string` }, + sessionId: { sql: 'sessionid', type: `string` }, + isSessionNew: { sql: 'isSessionNew', type: `boolean` }, + createdAt: { sql: 'createdAt', type: `time`, }, + sourceIp: { sql: 'source_ip', type: `string` }, + language: { sql: 'language', type: `string` }, + languageId: { sql: 'languageid', type: `string` }, + userAgent: { sql: 'user_agent', type: `string` }, + referer: { sql: 'referer', type: `string` }, + persona: { sql: 'persona', type: `string` }, + url: { sql: 'url', type: `string` }, + forwardTo: { sql: 'vanity_forward_to', type: `string` }, + action: { sql: 'vanity_action', type: `string` }, + eventsType: { sql: 'events_type', type: `string` } + }, + measures: { + count: { + type: "count" + }, + totalSessions: { + sql: 'sessionid', + type: 'countDistinct', + title: 'Total Sessions' + }, + totalRequest: { + sql: 'request_id', + type: 'countDistinct', + title: 'Total Requests' + }, + fileRequest: { + sql: `CASE WHEN ${CUBE}.baseType = 'FILEASSET' THEN 1 ELSE NULL END`, + type: 'count', + title: 'Count of FileAsset Request' + }, + fileRequestAverage: { + sql: `${fileRequest} / NULLIF(${totalRequest}, 0)`, + type: 'number', + title: 'FileRequest Average' + }, + pageRequest: { + sql: `CASE WHEN ${CUBE}.baseType = 'HTMLPAGE' THEN 1 ELSE NULL END`, + type: 'count', + title: 'Count of Page request' + }, + pageRequestAverage: { + sql: `${pageRequest} / NULLIF(${totalRequest}, 0)`, + type: 'number', + title: 'Page Request Average' + }, + otherRequestAverage: { + sql: `(${totalRequest} - (${fileRequest} + ${pageRequest})) / NULLIF(${totalRequest}, 0)`, + type: 'number', + title: 'No FIle OR Page Average' + } + + } +}); \ No newline at end of file From 139f2db5553f1f338e9986be2cbcf1e03c6af5e0 Mon Sep 17 00:00:00 2001 From: freddyDOTCMS Date: Fri, 17 Jan 2025 09:18:12 -0600 Subject: [PATCH 2/4] Enabling events scope in CA --- .../analytics/setup/config/dev/cube/schema/Events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js index d79c0bad55b..0c270038b2e 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js @@ -268,7 +268,7 @@ cube('request', { } }); -cube('events', { +cube('ca_events', { sql: `select * from events`, dimensions: { conHost: { sql: 'conHost', type: `string` }, From 76073162e4c3eefc52fa42edea8623549ffc4558 Mon Sep 17 00:00:00 2001 From: Jose Castro Date: Fri, 17 Jan 2025 12:48:35 -0600 Subject: [PATCH 3/4] Foxing potential type in dimension and column name -- an extra S. Updating the scheme's name from `ca_events` to `events` --- .../analytics/setup/config/dev/cube/schema/Events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js index 0c270038b2e..e77ffdf3278 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js @@ -268,7 +268,7 @@ cube('request', { } }); -cube('ca_events', { +cube('events', { sql: `select * from events`, dimensions: { conHost: { sql: 'conHost', type: `string` }, @@ -296,7 +296,7 @@ cube('ca_events', { url: { sql: 'url', type: `string` }, forwardTo: { sql: 'vanity_forward_to', type: `string` }, action: { sql: 'vanity_action', type: `string` }, - eventsType: { sql: 'events_type', type: `string` } + eventType: { sql: 'event_type', type: `string` } }, measures: { count: { From d3dbb3030ed58c7220b89bd34899fda7b362ffa4 Mon Sep 17 00:00:00 2001 From: Jose Castro Date: Tue, 21 Jan 2025 16:10:13 -0600 Subject: [PATCH 4/4] Adding missing dimension --- .../analytics/setup/config/dev/cube/schema/Events.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js index e77ffdf3278..5604a0c41b7 100644 --- a/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js +++ b/docker/docker-compose-examples/analytics/setup/config/dev/cube/schema/Events.js @@ -296,7 +296,8 @@ cube('events', { url: { sql: 'url', type: `string` }, forwardTo: { sql: 'vanity_forward_to', type: `string` }, action: { sql: 'vanity_action', type: `string` }, - eventType: { sql: 'event_type', type: `string` } + eventType: { sql: 'event_type', type: `string` }, + eventSource: { sql: 'event_source', type: `string` } }, measures: { count: {