# Set Customer Info

When the App opens or when the user logs in, fire the following event so that user information is associated with all the tags

The setCustomerInfo method only needs to be invoked once when the user has logged in and you have the customer information that can be set. Once set, it will continue to be passed along to all the other events. When the app re-opens, this needs to be invoked again.

Copy

```
MagicPixel.setCustomerInfo({
    phone_number: '<phone number>',     // mandatory
    country_code: 1, // mandatory
    first_name: '<first name if available>', // full name split by space and part[0], optional
    last_name: '<last name if available>', // full name split by space and part[1], optional
    city: '<lower case city name>', // lower case, no space, optional
    state: '<lower case no space state name>', // lower case, no space, optional
    country: 'in', // hardcoded to in
});
```

When the customer logs in fire the following event

Copy

```
MagicPixel.recordEvent('login', {
    method: 'phone'
});
```

### [Direct link to heading](#set-firebase-app-instance-id) Set Firebase App Instance Id

For GA4 to work properly in the backend, set the firebase app instance id as below when the app opens

Copy

```
MagicPixel.setFirebaseAppInstanceId("asdfasdf");
```

If using RNFirebase library, the app instance id can be fetched as detailed in the below link.

[![Logo](/files/5dcf14da8d7bf6f50b5afe26778ee50959c4d408)Analytics | React Native FirebaseReact Native Firebase](https://rnfirebase.io/analytics/usage#app-instance-id)

Fetching App Instance Id

Example

Copy

```
import analytics from '@react-native-firebase/analytics';

const appInstanceId = await analytics().getAppInstanceId();

MagicPixel.setFirebaseAppInstanceId(appInstanceId);
```

[PreviousSet Device Info](/implementation/react-native-sdk/tracking-events/set-device-info.md) [NextPage Load](/implementation/react-native-sdk/tracking-events/page-load.md)

Last updated 9 minutes ago


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ingestlabs.com/implementation/react-native-sdk/tracking-events/set-customer-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
