-
Notifications
You must be signed in to change notification settings - Fork 333
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
Custom name/properties for auto screen reporting #771
Conversation
Codecov Report
@@ Coverage Diff @@
## master #771 +/- ##
==========================================
- Coverage 86.89% 85.02% -1.88%
==========================================
Files 52 52
Lines 2793 2691 -102
==========================================
- Hits 2427 2288 -139
- Misses 366 403 +37 |
Is there anything in this PR that you'd like to see changed? |
hey @humblehacker sorry for the delay. I do have a question before diving too much into the implementation. If a customer has to write code to get this to work (i.e. they have to implement the new protocol), wouldn't it be just as easy to call |
Thanks for the response. Yes, they could just call |
So far automatic screen recording is very binary - you either use it or you don't. I would like to avoid complicating the feature set too much. But agreed it would be nice to have a way to customize the calls somehow. Maybe.... instead of a protocol with three properties, we could have the protocol be something like this:
Then if our library detects this, instead of calling screen directly, it calls the Another similar idea would be:
Then if our library detects this, it doesn't call screen at all and lets the customer record screen manually. It's a bit hard to decide since we don't have a lot of customers who have really asked for this yet. I would suggest we leave this open so folks can leave some feedback on this before we decide to proceed. How does that sound? |
That's a reasonable compromise -- accomplishes the same goal with slightly less complexity. I prefer your first suggestion over the second. Though maybe This eliminates two properties from the protocol, but the third property ( I'm fine with leaving this open for a while to gather feedback. |
6ff792a
to
c374b1e
Compare
@f2prateek I've updated the PR to simplify the protocol, as you suggested. Thoughts? |
Hello again. Is there anything I can do to help move this along? |
Sorry for the delay! I think this looks reasonable to me - could we add some tests? I don't anything else is blocking this - cc @fathyb to hear your thoughts too! |
Is there anything left to move this along? We have a tab bar app and would like to use auto tracking :) |
Is there any way to do auto-screen tracking with container views? I can't seem to find any information about this feature, and this PR sounds like it will fix the issue. |
Inspired by comments from @f2prateek, simplify the the `SEGScreenReporting` protocol to replace the name and properties fields with a single method (`seg_trackScreen`) that can be implemented when screen tracking for a specific view controller that needs a custom name, properties, or options.
I've rebased against master and added some tests. Let me know if there's anything else I can do. |
Not sure why, but |
I realize it's been a while since this PR was opened. Is there any chance for its acceptance? |
Thanks @humblehacker !! Sorry for the extreme delay getting this in. I did the fixups needed and made sure the tests were kosher. Thanks again!! |
ps. #884 is the PR for this in progress release where your changes will come in. |
Hey thanks for this fix! It's exactly what we were looking for. Is there a way to not have the |
@kowongh there's not currently a way to do that. You wanna throw up a PR with the logic changes you'd like and I can spin another release once we've agreed? |
I don't see I don't understand how to implement this protocol, an example or some documentation would go a long way.
EDIT: someone has posted an example in #885. |
What does this PR do?
Adds the ability to specify a custom name and custom properties during
automatic screen reporting.
Also fixes
seg_topViewController()
forUITabBarController
and customcontainer view controllers.
Where should the reviewer start?
UIViewController.seg_viewDidAppear()
How should this be manually tested?
SEGScreenReporting
protocol.
seg_trackScreen
to override the default screen tracking. Your implementation should callseg_screen
with custom values for thescreen
,properties
and/oroptions
arguments.seg_mainViewController
to specify which child viewcontroller of a custom container view controller should be referenced
when determining the top view controller (
seg_topViewController()
)Any background context you want to provide?
None
What are the relevant tickets?
Fixes #654
Screenshots or screencasts (if UI/UX change)
No UI/UX change
Questions:
Do the docs need an update?
Yes
Are there any security concerns?
Not that I'm aware of
Do we need to update engineering / success?
Not sure what this means
@segmentio/gateway