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

Load destination plugins conditionally #1172

Closed
vrugtehagel opened this issue Jan 21, 2025 · 3 comments
Closed

Load destination plugins conditionally #1172

vrugtehagel opened this issue Jan 21, 2025 · 3 comments
Assignees

Comments

@vrugtehagel
Copy link

Summary

I'd like to be able to load destination plugins conditionally. We've got a setup that loads Jitsu analytics through the @jitsu/js package. We use Jitsu itself only for statistical purposes, whereas our GTM destination also sets cookies of the marketing variety. As such, when a user has "statistics" enabled, but "marketing" disabled, we cannot load Jitsu at all, since it causes GTM to be loaded. What is the appropriate solution for this?

A suggested solution; it'd be great if the NPM package was a bit more modular, where I can specifically import and load plugins where needed. This would solve my issue, and downsize the Jitsu bundle significantly, since it now loads all destination plugins regardless of whether they are going to be used.

Copy link

github-actions bot commented Feb 6, 2025

This issue is stale because it has been open for 30 days with no activity.

@vklimontovich
Copy link
Contributor

The code doesn't load GTM unless you enabled it. It just contains a function that can load it. The javascript is very small, so there's very little benefit in making it modular.

@vrugtehagel
Copy link
Author

@vklimontovich the original question remains; how would one conditionally load a plugin from the front-end? We want to load GTM based on consent (which is a different category than loading Jitsu), without having to send their consent to the server. Is this at all possible?

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

No branches or pull requests

2 participants