mirror of
https://github.com/foomo/sesamy-cli.git
synced 2025-10-16 12:35:36 +00:00
feat(provider/tracify): add staging mode config
This commit is contained in:
parent
84131bd076
commit
53e4b278dd
@ -11,6 +11,8 @@ type Tracify struct {
|
|||||||
Token string `json:"token" yaml:"token"`
|
Token string `json:"token" yaml:"token"`
|
||||||
// Tracify customer site id
|
// Tracify customer site id
|
||||||
CustomerSiteID string `json:"customerSiteId" yaml:"customerSiteId"`
|
CustomerSiteID string `json:"customerSiteId" yaml:"customerSiteId"`
|
||||||
|
// Enable stating mode
|
||||||
|
StagingModeEnabled bool `json:"stagingModeEnabled" yaml:"stagingModeEnabled"`
|
||||||
// Google Consent settings
|
// Google Consent settings
|
||||||
GoogleConsent GoogleConsent `json:"googleConsent" yaml:"googleConsent"`
|
GoogleConsent GoogleConsent `json:"googleConsent" yaml:"googleConsent"`
|
||||||
// Google Tag Manager server container settings
|
// Google Tag Manager server container settings
|
||||||
|
|||||||
@ -64,7 +64,7 @@ func Server(l *slog.Logger, tm *tagmanager.TagManager, cfg config.Tracify) error
|
|||||||
return errors.Wrap(err, "failed to upsert event trigger: "+event)
|
return errors.Wrap(err, "failed to upsert event trigger: "+event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := tm.UpsertTag(servertagx.NewTracify(event, token, customerSiteID, tagTemplate, eventTrigger)); err != nil {
|
if _, err := tm.UpsertTag(servertagx.NewTracify(event, token, customerSiteID, tagTemplate, cfg, eventTrigger)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package tag
|
package tag
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/foomo/sesamy-cli/pkg/config"
|
||||||
"github.com/foomo/sesamy-cli/pkg/utils"
|
"github.com/foomo/sesamy-cli/pkg/utils"
|
||||||
"google.golang.org/api/tagmanager/v2"
|
"google.golang.org/api/tagmanager/v2"
|
||||||
)
|
)
|
||||||
@ -9,7 +12,7 @@ func TracifyName(v string) string {
|
|||||||
return "Tracify - " + v
|
return "Tracify - " + v
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTracify(name string, token, customerSiteID *tagmanager.Variable, template *tagmanager.CustomTemplate, triggers ...*tagmanager.Trigger) *tagmanager.Tag {
|
func NewTracify(name string, token, customerSiteID *tagmanager.Variable, template *tagmanager.CustomTemplate, cfg config.Tracify, triggers ...*tagmanager.Trigger) *tagmanager.Tag {
|
||||||
return &tagmanager.Tag{
|
return &tagmanager.Tag{
|
||||||
FiringTriggerId: utils.TriggerIDs(triggers),
|
FiringTriggerId: utils.TriggerIDs(triggers),
|
||||||
Name: TracifyName(name),
|
Name: TracifyName(name),
|
||||||
@ -28,7 +31,7 @@ func NewTracify(name string, token, customerSiteID *tagmanager.Variable, templat
|
|||||||
{
|
{
|
||||||
Key: "isStagingMode",
|
Key: "isStagingMode",
|
||||||
Type: "boolean",
|
Type: "boolean",
|
||||||
Value: "false",
|
Value: strconv.FormatBool(cfg.StagingModeEnabled),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "token",
|
Key: "token",
|
||||||
|
|||||||
@ -535,6 +535,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Tracify customer site id"
|
"description": "Tracify customer site id"
|
||||||
},
|
},
|
||||||
|
"stagingModeEnabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Enable stating mode"
|
||||||
|
},
|
||||||
"googleConsent": {
|
"googleConsent": {
|
||||||
"$ref": "#/$defs/github.com.foomo.sesamy-cli.pkg.config.GoogleConsent",
|
"$ref": "#/$defs/github.com.foomo.sesamy-cli.pkg.config.GoogleConsent",
|
||||||
"description": "Google Consent settings"
|
"description": "Google Consent settings"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user