Skip to content

Commit

Permalink
Merge pull request #808 from rudderlabs/main
Browse files Browse the repository at this point in the history
fix(ga4): back merge changes
  • Loading branch information
mihir-4116 authored Aug 2, 2023
2 parents c68062b + 422cc71 commit 98feab8
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 27 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.43.2](https://github.com/rudderlabs/rudder-config-schema/compare/v1.43.1...v1.43.2) (2023-08-01)


### Bug Fixes

* **ga4:** firebaseAppId config field issue ([3d1bccc](https://github.com/rudderlabs/rudder-config-schema/commit/3d1bccc3a06d70c5052347c51e4bb34865529727))

### [1.43.1](https://github.com/rudderlabs/rudder-config-schema/compare/v1.43.0...v1.43.1) (2023-07-28)

## [1.43.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.42.2...v1.43.0) (2023-07-24)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-config-schema",
"version": "1.43.1",
"version": "1.43.2",
"description": "",
"main": "src/index.ts",
"private": true,
Expand Down
151 changes: 130 additions & 21 deletions src/configurations/destinations/ga4/schema.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
{
"configSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"required": ["apiSecret", "typesOfClient", "measurementId", "firebaseAppId"],
"required": [
"apiSecret",
"typesOfClient"
],
"type": "object",
"properties": {
"apiSecret": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
},
"typesOfClient": { "type": "string", "enum": ["gtag", "firebase"], "default": "gtag" },
"measurementId": {
"typesOfClient": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$"
"enum": [
"gtag",
"firebase"
],
"default": "gtag"
},
"firebaseAppId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
"debugMode": {
"type": "boolean",
"default": false
},
"debugMode": { "type": "boolean", "default": false },
"eventFilteringOption": {
"type": "string",
"enum": ["disable", "whitelistedEvents", "blacklistedEvents"],
"enum": [
"disable",
"whitelistedEvents",
"blacklistedEvents"
],
"default": "disable"
},
"whitelistedEvents": {
Expand Down Expand Up @@ -61,30 +70,130 @@
},
"capturePageView": {
"type": "object",
"properties": { "web": { "type": "string", "enum": ["rs", "gtag"], "default": "rs" } }
"properties": {
"web": {
"type": "string",
"enum": [
"rs",
"gtag"
],
"default": "rs"
}
}
},
"debugView": {
"type": "object",
"properties": {
"web": {
"type": "boolean"
}
}
},
"extendPageViewParams": {
"type": "object",
"properties": {
"web": {
"type": "boolean"
}
}
},
"debugView": { "type": "object", "properties": { "web": { "type": "boolean" } } },
"extendPageViewParams": { "type": "object", "properties": { "web": { "type": "boolean" } } },
"overrideClientAndSessionId": {
"type": "object",
"properties": { "web": { "type": "boolean" } }
"properties": {
"web": {
"type": "boolean"
}
}
},
"useNativeSDK": {
"type": "object",
"properties": {
"android": { "type": "boolean" },
"ios": { "type": "boolean" },
"web": { "type": "boolean" }
"android": {
"type": "boolean"
},
"ios": {
"type": "boolean"
},
"web": {
"type": "boolean"
}
}
},
"connectionMode": {
"type": "object",
"properties": {
"android": { "type": "string", "enum": ["cloud", "device"] },
"ios": { "type": "string", "enum": ["cloud", "device"] },
"web": { "type": "string", "enum": ["cloud", "device", "hybrid"] }
"android": {
"type": "string",
"enum": [
"cloud",
"device"
]
},
"ios": {
"type": "string",
"enum": [
"cloud",
"device"
]
},
"web": {
"type": "string",
"enum": [
"cloud",
"device",
"hybrid"
]
}
}
}
},
"allOf": [
{
"if": {
"properties": {
"typesOfClient": {
"const": "gtag"
}
},
"required": [
"typesOfClient"
]
},
"then": {
"properties": {
"measurementId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$"
}
},
"required": [
"measurementId"
]
}
},
{
"if": {
"properties": {
"typesOfClient": {
"const": "firebase"
}
},
"required": [
"typesOfClient"
]
},
"then": {
"properties": {
"firebaseAppId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$"
}
},
"required": [
"firebaseAppId"
]
}
}
}
]
}
}
}
2 changes: 1 addition & 1 deletion src/configurations/destinations/ga4/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"label": "Firebase App Id",
"configKey": "firebaseAppId",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$",
"regexErrorMessage": "Invalid Firebase App Id",
"note": "Enter the ID associated with your stream. Find this under Admin > Data Streams > choose your stream > Firebase App ID",
"placeholder": "e.g: 2:637908496727:web:a4284b4c99e329d5",
Expand Down
5 changes: 3 additions & 2 deletions test/data/validation/destinations/ga4.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
},
"result": false,
"err": [
"measurementId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$\""
"measurementId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$\"",
" must match \"then\" schema"
]
},
{
Expand Down Expand Up @@ -294,4 +295,4 @@
},
"result": true
}
]
]

0 comments on commit 98feab8

Please sign in to comment.