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"`
|
||||
// Tracify customer site id
|
||||
CustomerSiteID string `json:"customerSiteId" yaml:"customerSiteId"`
|
||||
// Enable stating mode
|
||||
StagingModeEnabled bool `json:"stagingModeEnabled" yaml:"stagingModeEnabled"`
|
||||
// Google Consent settings
|
||||
GoogleConsent GoogleConsent `json:"googleConsent" yaml:"googleConsent"`
|
||||
// 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)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package tag
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/foomo/sesamy-cli/pkg/config"
|
||||
"github.com/foomo/sesamy-cli/pkg/utils"
|
||||
"google.golang.org/api/tagmanager/v2"
|
||||
)
|
||||
@ -9,7 +12,7 @@ func TracifyName(v string) string {
|
||||
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{
|
||||
FiringTriggerId: utils.TriggerIDs(triggers),
|
||||
Name: TracifyName(name),
|
||||
@ -28,7 +31,7 @@ func NewTracify(name string, token, customerSiteID *tagmanager.Variable, templat
|
||||
{
|
||||
Key: "isStagingMode",
|
||||
Type: "boolean",
|
||||
Value: "false",
|
||||
Value: strconv.FormatBool(cfg.StagingModeEnabled),
|
||||
},
|
||||
{
|
||||
Key: "token",
|
||||
|
||||
@ -535,6 +535,10 @@
|
||||
"type": "string",
|
||||
"description": "Tracify customer site id"
|
||||
},
|
||||
"stagingModeEnabled": {
|
||||
"type": "boolean",
|
||||
"description": "Enable stating mode"
|
||||
},
|
||||
"googleConsent": {
|
||||
"$ref": "#/$defs/github.com.foomo.sesamy-cli.pkg.config.GoogleConsent",
|
||||
"description": "Google Consent settings"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user