The Analytics category enables you to collect analytics data for your App. The Analytics category comes with built-in support for [Amazon Pinpoint](https://aws.amazon.com/pinpoint) and [Amazon Kinesis](https://aws.amazon.com/kinesis) (Kinesis support is currently only available in the Amplify JavaScript library). The Analytics category uses [Amazon Cognito Identity pools](https://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html) to identify users in your App. Cognito allows you to receive data from authenticated, and unauthenticated users in your App. ## Goal To setup and configure your application with Amplify Analytics and record an analytics event. ## Prerequisites import ios0 from "/src/fragments/lib-v1/analytics/ios/getting-started/10_preReq.mdx"; import android1 from "/src/fragments/lib-v1/analytics/android/getting-started/10_preReq.mdx"; import flutter2 from '/src/fragments/lib-v1/analytics/flutter/getting-started/10_preReq.mdx'; ## Set up Analytics backend Run the following command in your project's root folder. The CLI will prompt configuration options for the Analytics category such as Amazon Pinpoint resource name and analytics event settings. > The Analytics category utilizes the Authentication category behind the scenes to authorize your app to send analytics events. ```bash amplify add analytics ``` ```console ? Select an Analytics provider (Use arrow keys) `Amazon Pinpoint` ? Provide your pinpoint resource name: `yourPinpointResourceName` ? Apps need authorization to send analytics events. Do you want to allow guests and unauthenticated users to send analytics events? (we recommend you allow this when getting started) `Yes` ``` To deploy your backend, run: ```bash amplify push ``` import ios3 from "/src/fragments/lib-v1/analytics/ios/getting-started/12_amplifyConfig.mdx"; import android4 from "/src/fragments/lib-v1/analytics/android/getting-started/12_amplifyConfig.mdx"; import flutter5 from '/src/fragments/lib-v1/analytics/flutter/getting-started/12_amplifyConfig.mdx'; ## Install Amplify Libraries import ios6 from "/src/fragments/lib-v1/analytics/ios/getting-started/20_installLib.mdx"; import android7 from "/src/fragments/lib-v1/analytics/android/getting-started/20_installLib.mdx"; import flutter8 from '/src/fragments/lib-v1/analytics/flutter/getting-started/20_installLib.mdx'; ## Initialize Amplify Analytics import ios9 from "/src/fragments/lib-v1/analytics/ios/getting-started/30_initAnalytics.mdx"; import android10 from "/src/fragments/lib-v1/analytics/android/getting-started/30_initAnalytics.mdx"; import flutter11 from '/src/fragments/lib-v1/analytics/flutter/getting-started/30_initAnalytics.mdx'; import ios12 from "/src/fragments/lib-v1/analytics/ios/getting-started/40_record.mdx"; import android13 from "/src/fragments/lib-v1/analytics/android/getting-started/40_record.mdx"; ## View Analytics console If you have not saved the link from before, you can still reach it from the terminal. Run the following command for opening the console. ```console amplify console analytics ``` Next Steps: Congratulations! Now that you have Analytics' backend provisioned and Analytics library installed. Check out the following links to see Amplify Analytics use cases: * [Record Events](/lib-v1/analytics/record) * [Track Sessions](/lib-v1/analytics/autotrack) * [Identify User](/lib-v1/analytics/identifyuser) * [Escape Hatch](/lib-v1/analytics/escapehatch)