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

feat(docs): autocapture for iOS #9783

Merged
merged 9 commits into from
Nov 11, 2024
Merged

feat(docs): autocapture for iOS #9783

merged 9 commits into from
Nov 11, 2024

Conversation

ioannisj
Copy link
Contributor

@ioannisj ioannisj commented Nov 1, 2024

Changes

Added iOS documentation for Autocapture feature

Relates to: PostHog/posthog-ios#224

Useful resources

@ioannisj ioannisj requested a review from a team November 1, 2024 16:07
Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ✅ Ready (Inspect) Visit Preview Nov 11, 2024 9:06am

Copy link
Member

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments but its more suggestions so all good.

Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
@ioannisj
Copy link
Contributor Author

ioannisj commented Nov 7, 2024

@marandaneto reworked this a bit. I decided skip to include just a single config for now captureElementInteractions (it also matches what we already have). For any concerns about PII users can use ph-no-caputre for now. If this looks okay to you I'll start working on the changes in PostHog/posthog-ios#224

@ivanagas I moved everything to send-event-ios.mdx will that work? Doesn't show up in the menu on the right but hopefully this will be fixed globally for the site posthog.slack.com/archives/C01V9AT7DK4/p1690967096749549

Comment on lines 41 to 49
To exclude specific UI elements from Autocapture, add `ph-no-capture` as either an `accessibilityLabel` or `accessibilityIdentifier`. When Autocapture detects this label or identifier anywhere in the view hierarchy, the event will be ignored:

```swift
// This view will be excluded from Autocapture
let view = UIView()
view.accessibilityLabel = "ph-no-capture"
```

> **Important:** By default, PostHog automatically excludes fields detected as sensitive, even without the `ph-no-capture` tag. These include password fields, credit card fields, OTP fields, and any other fields related to Personally Identifiable Information (PII).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the autocapture reuse the checks from session replay? just to be sure this is here in this section and it works for captureElementInteractions as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's why I didn't move this inside Autocapture specifically.

Maybe we can change to "To exclude specific UI elements from Autocapture or Session replay ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, not sure about the strong disclaimer at the bottom. Maybe we can reword to something like "By default, PostHog makes a best effort to automatically exclude..."?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have posthog.com/contents/docs/session-replay/_snippets/ios-privacy.mdx btw, maybe consider improving that area and linking it back here if possible?
i think there are other areas of the docs mentioning about the ph no capture and what is automatically masked already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we also mention this in posthog.com/contents/tutorials/ios-session-replay.mdx as well. I think since this is not specific to session replay anymore, we can link the other way around. Include this in library docs and link back from session replay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this PR though to get the docs out, then follow up with a fix for tutorials and ios-privacy

@marandaneto
Copy link
Member

@marandaneto reworked this a bit. I decided skip to include just a single config for now captureElementInteractions (it also matches what we already have). For any concerns about PII users can use ph-no-caputre for now. If this looks okay to you I'll start working on the changes in PostHog/posthog-ios#224

@ivanagas I moved everything to send-event-ios.mdx will that work? Doesn't show up in the menu on the right but hopefully this will be fixed globally for the site posthog.slack.com/archives/C01V9AT7DK4/p1690967096749549

left a few comments, I think you forgot to update a few parts of the docs after removing the autocapture config object and going forward with only captureElementInteractions

Copy link
Contributor

@ivanagas ivanagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your snippet approach looks good.

Added some minor cleanup comments, like using sentence case for feature names (like autocapture).

contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/_snippets/autocapture.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/index.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/index.mdx Outdated Show resolved Hide resolved
contents/docs/libraries/ios/index.mdx Outdated Show resolved Hide resolved
Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com>
@ioannisj
Copy link
Contributor Author

Your snippet approach looks good.

Added some minor cleanup comments, like using sentence case for feature names (like autocapture).

Thank you @ivanagas! I misread the template and thought the complete opposite actually for some reason. I'll keep this in mind for future PRs

@ioannisj ioannisj merged commit 3ce50e7 into master Nov 11, 2024
3 checks passed
@ioannisj ioannisj deleted the feat/ios-autocapture branch November 11, 2024 10:22
danielbachhuber pushed a commit that referenced this pull request Nov 12, 2024
* feat(docs): autocapture for iOS

* feat(docs): iOS autocapture docs

* Update contents/docs/libraries/ios/index.mdx

Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>

* feat(docs): reworked iOS autocapture docs

* Apply suggestions from code review

Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com>

* fix: remove disabling autocapture section

* fix: rework all configuration options section

* fix: improve preventing sensitive data capture section

* fix: reword

---------

Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com>
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.

3 participants