Merge pull request #96 from foomo/v0.15.0

feat: add server container url
This commit is contained in:
Kevin Franklin Kim 2025-03-05 10:08:33 +01:00 committed by GitHub
commit 6f20c9bf96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 0 deletions

View File

@ -113,6 +113,8 @@ googleTag:
tagId: G-PZ5ELRCR31
# Whether a page_view should be sent on initial load
sendPageView: true
# Optional custom server container url
serverContainerUrl: ''
# TypeScript settings
typeScript:
# Target directory for generate files

View File

@ -5,6 +5,8 @@ type GoogleTag struct {
TagID string `json:"tagId" yaml:"tagId"`
// Whether a page_view should be sent on initial load
SendPageView bool `json:"sendPageView" yaml:"sendPageView"`
// Optional custom server container url
ServerContainerURL string `json:"serverContainerUrl" yaml:"serverContainerUrl"`
// Data layer variables to be added to the event settings
DataLayerVariables map[string]string `json:"dataLayerVariables" yaml:"dataLayerVariables"`
// TypeScript settings

View File

@ -26,6 +26,9 @@ func Web(tm *tagmanager.TagManager, cfg config.GoogleTag) error {
if !cfg.SendPageView {
configSettings["send_page_view"] = "false"
}
if cfg.ServerContainerURL != "" {
configSettings["server_container_url"] = cfg.ServerContainerURL
}
eventSettings := map[string]*api.Variable{}
for k, v := range cfg.DataLayerVariables {

View File

@ -425,6 +425,10 @@
"type": "boolean",
"description": "Whether a page_view should be sent on initial load"
},
"serverContainerUrl": {
"type": "string",
"description": "Optional custom server container url"
},
"dataLayerVariables": {
"$ref": "#/$defs/map[string]string",
"description": "Data layer variables to be added to the event settings"

View File

@ -61,6 +61,8 @@ googleTag:
tagId: G-PZ5ELRCR31
# Whether a page_view should be sent on initial load
sendPageView: true
# Optional custom server container url
serverContainerUrl: ''
# Data layer variables to be added to the event settings
dataLayerVariables:
emarsys_page_view_id: emarsys.page_view_id