Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create tealium instance for custom environment #230

Open
mchauhan3-wooliesx opened this issue Jan 19, 2024 · 2 comments
Open

How to create tealium instance for custom environment #230

mchauhan3-wooliesx opened this issue Jan 19, 2024 · 2 comments

Comments

@mchauhan3-wooliesx
Copy link

In our project, we have a custom tealium environment created apart from the usual(defaults) one (which is QA/PROD/DEV). However when we create a TealiumConfig object, the environment which we passes is an enum and not a string.

val config = TealiumConfig(
            application,
            configData.accountName,
            configData.profileName,
            Environment.DEV
        )

I was wondering, how we can create a TealiumConfig instance for that custom environment like say for "test".

@jameskeith
Copy link
Contributor

Hi @mchauhan3-wooliesx
Thanks for flagging this - there isn't currently support for the custom environments, and it's certainly something that we can address in a future release. Was there a specific use-case you need it for? I'm happy to raise it as a request to update on our part.

There is likely to be relevant overrides for the common modules that should allow you to control which custom environment is used. e.g. for the TagManagement dispatcher, you can specify an override for the TagManagement URL used.

config.overrideTagManagementUrl = "https://tags.tiqcdn.com/.../test/mobile.html"

One thing to note, is that the Environment is also used to distinguish the file storage locations. That is, if tested on the same device using multiple environments, there will be directories corresponding to each; each with their own visitor id, datalayer etc. Overriding just a tagmanagement url will not change that. So running a test with QA as the environment, without the tagmanagement override, would have the same visitor id/datalayer as running it with the override - I don't know if that's an issue for your specific use-case, but it's worth knowing just in case.

@mchauhan3-wooliesx
Copy link
Author

Thank you for your reply @jameskeith. I will try to use overrideTagManagementUrl as you suggested to see if it covers everything for us. However, having an ability to configure it while defining TealiumConfig would be idea. Like how for iOS the environement is a String, same could be done for kotlin version too to make it easy to pass environment name. (https://github.com/Tealium/tealium-swift/blob/main/tealium/core/TealiumConfig.swift)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants