Skip to content

Commit

Permalink
feat(gtm): added support for environment configs (#1906)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs authored Feb 21, 2025
1 parent 2b51393 commit 302d2c7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/configurations/destinations/gtm/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"oneTrustCookieCategories",
"ketchConsentPurposes",
"consentManagement",
"eventFilteringOption"
"eventFilteringOption",
"environmentID",
"authorizationToken"
],
"excludeKeys": [],
"supportedSourceTypes": ["web"],
Expand All @@ -30,7 +32,9 @@
"serverUrl",
"blacklistedEvents",
"whitelistedEvents",
"eventFilteringOption"
"eventFilteringOption",
"environmentID",
"authorizationToken"
],
"web": [
"useNativeSDK",
Expand All @@ -40,6 +44,7 @@
"ketchConsentPurposes"
]
},
"dynamicConfigSupported": ["containerID", "serverUrl"],
"secretKeys": []
}
}
8 changes: 8 additions & 0 deletions src/configurations/destinations/gtm/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
}
}
},
"environmentID": {
"type": "string",
"pattern": "^(.{0,100})$"
},
"authorizationToken": {
"type": "string",
"pattern": "^(.{0,100})$"
},
"eventFilteringOption": {
"type": "string",
"enum": ["disable", "whitelistedEvents", "blacklistedEvents"],
Expand Down
18 changes: 18 additions & 0 deletions src/configurations/destinations/gtm/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
"regexErrorMessage": "Invalid URL",
"required": false,
"placeholder": "e.g: https://example.com"
},
{
"type": "textInput",
"label": "Environment ID",
"value": "environmentID",
"regex": "^(.{0,100})$",
"regexErrorMessage": "Invalid Environment ID",
"required": false,
"placeholder": "e.g: env-3"
},
{
"type": "textInput",
"label": "Authorization Token",
"value": "authorizationToken",
"regex": "^(.{0,100})$",
"regexErrorMessage": "Invalid Authorization Token",
"required": false,
"placeholder": "e.g: d7bhUC_Zj4q1FRT5KWOuQ"
}
]
},
Expand Down
23 changes: 23 additions & 0 deletions test/data/validation/destinations/gtm.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@
},
"result": true
},
{
"config": {
"containerID": "GTM-XXXX",
"serverUrl": "https://gtm.rudder.com",
"environmentID": "env-3",
"authorizationToken": "dfsgrsthetyh",
"eventFilteringOption": "whitelistedEvents",
"whitelistedEvents": [
{
"eventName": "registration"
}
],
"blacklistedEvents": [
{
"eventName": ""
}
],
"useNativeSDK": {
"web": true
}
},
"result": true
},
{
"config": {
"serverUrl": "https://gtm.rudder.com",
Expand Down

0 comments on commit 302d2c7

Please sign in to comment.