Skip to content

Commit

Permalink
Merge pull request #1320 from rudderlabs/feat.add-ga4-custom-domain-f…
Browse files Browse the repository at this point in the history
…ield

feat: added custom domain input field during ga4 setup
  • Loading branch information
manish339k authored Apr 24, 2024
2 parents a529b03 + e32579f commit c130057
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/configurations/destinations/ga4/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"overrideClientAndSessionId",
"oneTrustCookieCategories",
"ketchConsentPurposes",
"consentManagement"
"consentManagement",
"sdkBaseUrl"
],
"excludeKeys": [],
"supportedSourceTypes": [
Expand Down Expand Up @@ -68,7 +69,8 @@
"eventFilteringOption",
"piiPropertiesToIgnore",
"oneTrustCookieCategories",
"ketchConsentPurposes"
"ketchConsentPurposes",
"sdkBaseUrl"
],
"web": [
"debugView",
Expand Down
23 changes: 22 additions & 1 deletion src/configurations/destinations/ga4/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,28 @@
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$"
}
},
"required": ["measurementId"]
"required": ["measurementId"],
"allOf": [
{
"if": {
"properties": {
"connectionMode": {
"type": "object",
"properties": { "web": { "type": "string", "enum": ["device"] } }
}
},
"required": ["connectionMode"]
},
"then": {
"properties": {
"sdkBaseUrl": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]*|^$"
}
}
}
}
]
}
},
{
Expand Down
23 changes: 23 additions & 0 deletions src/configurations/destinations/ga4/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,29 @@
],
"default": "gtag"
},
{
"type": "textInput",
"preRequisites": {
"fields": [
{
"configKey": "typesOfClient",
"value": "gtag"
},
{
"configKey": "connectionMode.web",
"value": "device"
}
]
},
"label": "SDK Base URL",
"configKey": "sdkBaseUrl",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]*|^$",
"regexErrorMessage": "Please input a valid URL.",
"note": "Enter your GA4 SDK base URL, https://{SDK Base URL}/gtag/js. By default, it is https://www.googletagmanager.com.",
"placeholder": "e.g: https://www.example.com",
"default": "https://www.googletagmanager.com",
"secret": false
},
{
"type": "textInput",
"preRequisites": {
Expand Down
1 change: 1 addition & 0 deletions test/data/validation/destinations/ga4.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"apiSecret": "QyWIGHj8QhG2L4ePAPiXCA",
"typesOfClient": "gtag",
"measurementId": "F40RN6STS2",
"sdkBaseUrl": "https://www.example.com",
"firebaseAppId": "",
"capturePageView": {
"web": "rs"
Expand Down

0 comments on commit c130057

Please sign in to comment.