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

fix: add identify metrics call at metrics instance setup #8885

Closed
2 of 9 tasks
NicolasMassart opened this issue Mar 8, 2024 · 0 comments · Fixed by #8888
Closed
2 of 9 tasks

fix: add identify metrics call at metrics instance setup #8885

NicolasMassart opened this issue Mar 8, 2024 · 0 comments · Fixed by #8888
Assignees
Labels
release-7.18.0 Issue or pull request that will be included in release 7.18.0 team-mobile-platform

Comments

@NicolasMassart
Copy link
Contributor

What is this about?

In segment, in order to improve user props update, identification is expected as soon as possible. We currently only do it when optin and not at app start when user is already optin.
We may miss some properties updated.

Scenario

No response

Design

No response

Technical Details

add identify in the Metametrics.configure after metametricsId is ready

Threat Modeling Framework

No response

Acceptance Criteria

  • check identify is sent at app startup only when user has metrics enabled.
  • when metrics disabled, no identify and no track should be sent.
  • unit test updated if needed.

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

https://github.com/MetaMask/metamask-mobile/blob/main/app/core/Analytics/MetaMetrics.ts#L512-L529

@NicolasMassart NicolasMassart added team-mobile-platform release-7.18.0 Issue or pull request that will be included in release 7.18.0 labels Mar 8, 2024
@NicolasMassart NicolasMassart self-assigned this Mar 8, 2024
Cal-L added a commit that referenced this issue Mar 14, 2024
## **Description**

adds identify call at the end of metrics config

## **Related issues**

Fixes #8885

## **Manual testing steps**

```gherkin
Feature: identify on start

  Scenario: fresh install
    Given app is a fresh installed
    And first screen appears
    Then logs should display "MetaMetrics configured with ID: [UUID]"
    And no event is sent

  Scenario: wallet created
    Given wallet was created
    And user accepted metrics
    And first screen appears
    Then logs should display "INFO  IDENTIFY event saved {...}"
    And at least 1 event is sent
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

No IDENTIFY log at startup

### **After**

<img width="500" alt="image"
src="https://github.com/MetaMask/metamask-mobile/assets/4677568/2042f2fa-62a9-4bed-be61-3654ea16f581">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Cal Leung <cleun007@gmail.com>
@metamaskbot metamaskbot added the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 14, 2024
metamaskbot pushed a commit that referenced this issue Mar 14, 2024
## **Description**

adds identify call at the end of metrics config

## **Related issues**

Fixes #8885

## **Manual testing steps**

```gherkin
Feature: identify on start

  Scenario: fresh install
    Given app is a fresh installed
    And first screen appears
    Then logs should display "MetaMetrics configured with ID: [UUID]"
    And no event is sent

  Scenario: wallet created
    Given wallet was created
    And user accepted metrics
    And first screen appears
    Then logs should display "INFO  IDENTIFY event saved {...}"
    And at least 1 event is sent
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

No IDENTIFY log at startup

### **After**

<img width="500" alt="image"
src="https://github.com/MetaMask/metamask-mobile/assets/4677568/2042f2fa-62a9-4bed-be61-3654ea16f581">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Cal Leung <cleun007@gmail.com>
@cortisiko cortisiko removed the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-7.18.0 Issue or pull request that will be included in release 7.18.0 team-mobile-platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants