aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.43k stars 2.12k forks source link

Amplify Analytics - Auto-Tracked "Session Start" Events do not show in Pinpoint #10266

Closed wrsulliv closed 1 year ago

wrsulliv commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Analytics

Amplify Categories

analytics

Environment information

``` # Put output below this line System: OS: macOS 12.3 CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz Memory: 22.60 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v14.17.6/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Browsers: Brave Browser: 95.1.31.87 Chrome: 78.0.3904.87 Firefox: 84.0.2 Safari: 15.4 npmPackages: @ant-design/react-native: ^4.2.0 => 4.2.0 @aws-amplify/ui-react: 3.0.0 => 3.0.0 @aws-amplify/ui-react-internal: undefined () @aws-amplify/ui-react-legacy: undefined () @babel/core: ^7.12.9 => 7.18.6 (7.9.0) @babel/plugin-proposal-class-properties: ^7.8.3 => 7.18.6 (7.12.13, 7.0.0-beta.47) @babel/plugin-proposal-export-default-from: ^7.8.3 => 7.18.6 @babel/plugin-proposal-object-rest-spread: ^7.12.1 => 7.18.6 (7.0.0-beta.47) @babel/plugin-transform-typescript: ^7.12.1 => 7.18.8 @babel/preset-env: ^7.8.7 => 7.18.6 (7.12.17) @babel/preset-react: ^7.12.1 => 7.18.6 @babel/preset-typescript: ^7.15.0 => 7.18.6 (7.12.17) @cawfree/react-native-simpler-date-picker: 0.1.0-alpha.4 => 0.1.0-alpha.4 @expo/electron-adapter: ^0.0.55 => 0.0.55 @expo/match-media: ^0.3.0 => 0.3.0 @expo/vector-icons: ^13.0.0 => 13.0.0 @expo/webpack-config: ~0.16.21 => 0.16.25 @gorhom/portal: ^1.0.14 => 1.0.14 @react-native-async-storage/async-storage: ~1.17.3 => 1.17.7 @react-native-community/async-storage: ^1.12.1 => 1.12.1 @react-native-community/cameraroll: ^4.0.4 => 4.1.2 @react-native-community/datetimepicker: 6.1.2 => 6.1.2 @react-native-community/masked-view: ^0.1.11 => 0.1.11 @react-native-community/netinfo: 8.2.0 => 8.2.0 @react-native-community/picker: ^1.8.1 => 1.8.1 @react-native-community/segmented-control: ^2.2.2 => 2.2.2 @react-native-community/slider: 4.2.1 => 4.2.1 @react-native-community/toolbar-android: 0.1.0-rc.2 => 0.1.0-rc.2 @react-native-picker/picker: ^2.4.0 => 2.4.0 @react-navigation/bottom-tabs: 6.0.4 => 6.0.4 @react-navigation/compat: ^5.1.26 => 5.3.20 @react-navigation/drawer: ^6.3.1 => 6.4.3 @react-navigation/elements: 1.0.4 => 1.0.4 (1.3.4) @react-navigation/material-bottom-tabs: 6.0.4 => 6.0.4 @react-navigation/material-top-tabs: ^6.0.2 => 6.2.2 @react-navigation/native: ^6.0.8 => 6.0.11 @react-navigation/native-stack: 6.0.5 => 6.0.5 @react-navigation/stack: 6.0.6 => 6.0.6 @stripe/react-stripe-js: ^1.6.0 => 1.9.0 @stripe/stripe-js: ^1.21.2 => 1.32.0 @svgr/webpack: ^5.5.0 => 5.5.0 @types/color: ^3.0.1 => 3.0.3 @types/expo: ^26.0.4 => 26.0.10 @types/expo__vector-icons: ^9.0.1 => 9.0.1 @types/jest: ^23.0.0 => 23.3.14 @types/react: ^18.0.15 => 18.0.15 (16.14.28) @types/react-color: ^3.0.1 => 3.0.6 @types/react-native: ~0.67.6 => 0.67.11 (0.69.2) @types/react-native-datepicker: ^1.7.0 => 1.7.1 @types/react-native-elements: ^0.18.0 => 0.18.0 @types/react-redux: ^6.0.14 => 6.0.20 (7.1.24) @types/react-responsive: ^8.0.2 => 8.0.5 @types/react-router-dom: ^5.1.1 => 5.3.3 @types/react-router-native: ^4.2.4 => 4.2.4 @types/react-test-renderer: ^16.0.1 => 16.9.5 @types/redux: ^3.6.0 => 3.6.0 @types/redux-form: ^8.2.6 => 8.3.5 @types/shelljs: ^0.8.5 => 0.8.11 amazon-cognito-identity-js: ^5.2.9 => 5.2.10 aws-amplify: ^4.3.33 => 4.3.33 aws-amplify-react-native: 5.0.5 => 5.0.5 aws-sdk: 2.1133.0 => 2.1133.0 babel-plugin-import: ^1.13.3 => 1.13.5 babel-plugin-react-native-web: ^0.8.2 => 0.8.11 (0.17.7) babel-plugin-rewrite-require: ^1.14.5 => 1.14.5 babel-plugin-transform-inline-environment-variables: ^0.4.4 => 0.4.4 (0.0.2) babel-plugin-transform-object-rest-spread: ^6.26.0 => 6.26.0 babel-plugin-transform-react-jsx-source: ^6.22.0 => 6.22.0 babel-preset-env: ^1.7.0 => 1.7.0 babel-preset-es2015: ^6.24.1 => 6.24.1 babel-preset-expo: ~9.1.0 => 9.1.0 babel-preset-react-native: ^5.0.2 => 5.0.2 benchmark-uuid: undefined () color: ^3.1.3 => 3.2.1 (4.2.3) crypto-browserify: ^3.12.0 => 3.12.0 dagre: ^0.8.5 => 0.8.5 docuilib: 0.0.0 electron: ^19.0.4 => 19.0.8 electron-builder: ^22.9.1 => 22.14.13 eslint-plugin-uilib: 2.1.7 expo: ^45.0.0 => 45.0.6 expo-asset: ~8.5.0 => 8.5.0 expo-av: ~11.2.3 => 11.2.3 expo-blur: ~11.1.0 => 11.1.0 expo-cli: ^5.3.2 => 5.4.12 expo-file-system: ~14.0.0 => 14.0.0 expo-font: ~10.1.0 => 10.1.0 expo-image-picker: ~13.1.1 => 13.1.1 expo-linear-gradient: ~11.3.0 => 11.3.0 expo-linking: ~3.1.0 => 3.1.0 expo-permissions: ~13.2.0 => 13.2.0 expo-screen-orientation: ~4.2.0 => 4.2.0 expo-sharing: ~10.2.0 => 10.2.0 expo-speech: ~10.2.0 => 10.2.0 expo-splash-screen: ~0.15.1 => 0.15.1 expo-status-bar: ~1.3.0 => 1.3.0 expo-updates: ~0.13.3 => 0.13.3 flow-bin: ^0.66.0 => 0.66.0 global: ^4.4.0 => 4.4.0 hermes-inspector-msggen: 1.0.0 http-browserify: ^1.7.0 => 1.7.0 inherits: ^2.0.3 => 2.0.4 (2.0.3, 2.0.1) jest: ^26.6.3 => 26.6.3 jest-expo: ^45.0.0 => 45.0.1 lodash: ^4.17.15 => 4.17.21 (4.17.4, 3.10.1) metro-react-native-babel-preset: ^0.54.1 => 0.54.1 (0.67.0) modal-enhanced-react-native-web: ^0.2.0 => 0.2.0 moment: ^2.24.0 => 2.29.4 net-browserify: ^0.2.4 => 0.2.4 node-libs-browser: ^2.2.0 => 2.2.1 node-zillow: ^2.0.0 => 2.0.0 object-hash: ^2.2.0 => 2.2.0 patch-package: ^6.4.7 => 6.4.7 path-browserify: ^1.0.0 => 1.0.1 (0.0.1) proxyquire: ^2.1.0 => 2.1.3 react: 17.0.2 => 17.0.2 react-art: 16.3.1 => 16.3.1 react-color: ^2.17.3 => 2.19.3 react-dom: 17.0.2 => 17.0.2 react-flow-renderer: ^9.6.9 => 9.7.4 react-mailchimp-subscribe: ^2.1.3 => 2.1.3 react-native: 0.68.2 => 0.68.2 react-native-crypto: ^2.1.2 => 2.2.0 react-native-datepicker: ^1.7.2 => 1.7.2 react-native-dropdown-picker: ^5.4.2 => 5.4.2 react-native-elements: ^3.4.2 => 3.4.2 react-native-gesture-handler: ~2.2.1 => 2.2.1 react-native-linear-gradient: ^2.5.3 => 2.6.2 react-native-markdown-renderer: ^3.2.8 => 3.2.8 react-native-pager-view: 5.4.15 => 5.4.15 react-native-pages: ^0.9.0 => 0.9.0 react-native-paper: ^4.12.2 => 4.12.2 react-native-paper-dates: ^0.8.7 => 0.8.7 react-native-path: 0.0.5 => 0.0.5 react-native-progress-steps: ^1.3.4 => 1.3.4 react-native-randombytes: ^3.5.2 => 3.6.1 react-native-reanimated: ~2.8.0 => 2.8.0 react-native-safe-area-context: 4.2.4 => 4.2.4 react-native-screens: ~3.11.1 => 3.11.1 react-native-side-menu: ^1.1.3 => 1.1.3 react-native-super-grid: ^4.4.0 => 4.4.2 react-native-svg: 12.3.0 => 12.3.0 react-native-svg-transformer: ^1.0.0 => 1.0.0 react-native-tab-view: ^3.1.1 => 3.1.1 react-native-ui-lib: ^6.16.1 => 6.18.0 react-native-web: 0.17.7 => 0.17.7 react-native-webview: 11.18.1 => 11.18.1 react-redux: ^6.0.1 => 6.0.1 (7.2.8) react-responsive: ^8.1.0 => 8.2.0 react-router: ^5.2.0 => 5.3.3 react-router-dom: ^5.1.2 => 5.3.3 react-router-native: ^5.0.0 => 5.3.3 react-test-renderer: 17 => 17.0.2 react-web-view-pager: ^0.0.1 => 0.0.1 redux: ^4.2.0 => 4.2.0 redux-form: ^8.3.6 => 8.3.8 rewire: ^4.0.1 => 4.0.1 rn-nodeify: ^10.0.1 => 10.3.0 shelljs: ^0.8.3 => 0.8.5 stripe: ^10.0.0 => 10.0.0 tcomb-form-native: ^0.6.20 => 0.6.20 timers-browserify: ^2.0.10 => 2.0.12 ts-node: ^8.2.0 => 8.10.2 tslint: ^5.10.0 => 5.20.1 (6.1.3) twitter: ^1.7.1 => 1.7.1 typescript: ~4.3.5 => 4.3.5 uilib-native: 3.0.8 url-loader: ^4.1.1 => 4.1.1 uuid: ^3.3.2 => 3.4.0 (3.3.2, 8.3.2, 3.1.0, 2.0.3, 7.0.2, 7.0.3) vm-browserify: ^1.1.0 => 1.1.2 webpack: ^4.46.0 => 4.46.0 (4.43.0) workbox-background-sync: ^6.1.5 => 6.5.3 workbox-broadcast-update: ^6.1.5 => 6.5.3 workbox-cacheable-response: ^6.1.5 => 6.5.3 workbox-core: ^6.1.5 => 6.5.3 workbox-expiration: ^6.1.5 => 6.5.3 workbox-google-analytics: ^6.1.5 => 6.5.3 workbox-navigation-preload: ^6.1.5 => 6.5.3 workbox-precaching: ^6.1.5 => 6.5.3 workbox-range-requests: ^6.1.5 => 6.5.3 workbox-routing: ^6.1.5 => 6.5.3 workbox-strategies: ^6.1.5 => 6.5.3 workbox-streams: ^6.1.5 => 6.5.3 workbox-webpack-plugin: ^6.1.5 => 6.5.3 zipcodes: ^8.0.0 => 8.0.0 npmGlobalPackages: @aws-amplify/cli: 9.2.1 @nestjs/cli: 8.1.6 eas-cli: 0.54.1 expo-cli: 6.0.5 lighthouse: 9.6.3 npm: 6.14.15 react-native-cli: 2.0.1 serverless: 3.15.2 truffle: 5.4.16 ts-node: 10.4.0 typescript: 4.7.4 yarn: 1.22.19 ```

Describe the bug

After following the Amplify Docs for Auto-Tracking, I am not consistently seeing "_session_start" events in Pinpoint. I may receive 1-2 start events for every 40 end events.

Expected behavior

The number of session start / session end events should be equivalent for the same time period (make sure to test by opening / closing in the same period).

Reproduction steps

Follow the Amplify Setup Docs and check Pinpoint to see that only Session End events are being consistently tracked

https://docs.amplify.aws/lib/analytics/autotrack/q/platform/js/

Code Snippet

Analytics.configure(awsConfig);
Analytics.autoTrack('session', {
  enable: true,
  provider: 'AWSPinpoint'
});

Log output

[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 't.byteLength') [Error] [ERROR] 46:22.358 AWSPinpointProvider - updateEndpoint failed

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

cwomack commented 1 year ago

Hey @wrsulliv 👋 . I was able to reproduce the AWSPinpointProvider - updateEndpoint failed error that you're seeing. Can you try commenting out/removing the enable: true? I was able to eliminate the error in the console when that happened, but I'm wondering if there's a bug tied to the session start/end tied to this.

cwomack commented 1 year ago

Closing this issue as we have not received a response from you. If you are still experiencing this issue and in need of assistance, please feel free to comment back and provide any additional information requested or relevant.

Thank you!