-
Notifications
You must be signed in to change notification settings - Fork 23
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
Set user Id and custom dimension after plugin instantiation #22
Comments
Hi Kevin, I came across the exact scenario you bring up and went through the same thought process as you. I ended up just using I'm certainly open to suggestions and collaborating on a better abstraction. |
This would be really nice, especially for those of us using Typescript, as we can't call the |
I can imagine that would do exactly what I wanted, but unfortunately I no longer work for the company I was building that software for, so I have no way of testing at this time. |
Hi Everyone,
Was curious on what the community insight/feedback would be around setting data with the plugin after instantiation in main or after lazy initialization of the plugin in the page lifecycle of a module?
I was looking to pass a custom dimension for the user's role on our site in addition to the userId variable to track users across devices. The problem is that I dont get this data until the user is logged in which occurs in app.js after the events in main.js which has the Framework configuration for loading the plugin. Now, I could easily do the following:
ga('set', 'userId', '11111')
in the activate of the app.js module but I was looking for a way to keep the google analytics concerns internal to the plugin.
Another thought on this was to lazy load the plugin in the app.js activation using the FrameworkConfiguration class from aurelia-framwork:
then pass in the variables via init() as these params can also be included on the ga('create') initialization call but I was concerned about having this plugin instantiated outside of main.js where I am doing the remainder of the work setting up other plugins. I also didn't really like this sprinkled about in the application requiring someone to have to go looking for it.
thoughts on this? Curious on how others are handing this as well...
thanks!
Kevin
The text was updated successfully, but these errors were encountered: