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

Ignore calls to Analytics.track & Analytics.identify if the client is not initialized #6

Merged
merged 1 commit into from
Mar 13, 2013

Conversation

sbellity
Copy link
Contributor

No description provided.

@calvinfo
Copy link
Contributor

Hey, thanks for the pull! Can you give me a good use case of what this is for?

The original idea was to error out if the developer tries to make any sort of call pre-initialize. Throwing an error makes sure that in the normal install case, the developer will know that they have to initialize the client first. I'm a little worried that a developer might unknowingly lose some events if they end up calling initialize after track.

If there's a good case for it though, happy to merge it in!

@sbellity
Copy link
Contributor Author

With the current version, I have no way to know if Analytics has been initialized when I wan to call track or identify in my code.

In development mode for example, if I don't want to send tracking events or to initializes the lib, my only choice would be either to mock Analytics or to wrap calls to track or identify in begin/rescue blocks.

@calvinfo calvinfo merged commit 9ea1605 into segmentio:master Mar 13, 2013
@calvinfo
Copy link
Contributor

That makes sense to me, I just merged the new version.

If you'd like to test in development you can make a second 'test' project, but it shouldn't be a requirement. Thanks for the pull!

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

Successfully merging this pull request may close these issues.

None yet

2 participants