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

feature request: Set userInfo once #24

Open
angelxmoreno opened this issue Nov 13, 2023 · 2 comments
Open

feature request: Set userInfo once #24

angelxmoreno opened this issue Nov 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@angelxmoreno
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It would be nice if we could set default params on the instance of the tracker and have it use those values on subsequent calls.

Describe the solution you'd like
have the constructor take in a userInfo object that it merges with the params sent to the matomo server.

Describe alternatives you've considered
Currently, I need to make a series of async calls to populate the userInfo object. Setting them once would improve app performance.

Additional context
none

@angelxmoreno angelxmoreno added the enhancement New feature or request label Nov 13, 2023
@donni106
Copy link
Owner

Good point! This would make it even more straight forward to use.

@angelxmoreno
Copy link
Contributor Author

angelxmoreno commented Nov 20, 2023

as part of this PR I'd like to add userInfo defaults. Here are a few mentioned in #13

import {Dimensions} from "react-native";
import Constants from "expo-constants";
import * as Localization from "expo-localization";
{
  lang: Localization.locale,
  res: `${Dimentions.get('screen').width}x${Dimentions.get('screen').height}`,
  ua: await Constants.getWebViewUserAgentAsync(),
  _id: Constants.sessionId,
}

@donni106 donni106 added this to the 0.3.2 milestone Jan 2, 2024
@donni106 donni106 modified the milestones: 0.3.2, 0.3.3 Feb 1, 2024
dynamichny pushed a commit to dynamichny/matomo-tracker-react-native that referenced this issue Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants