Amplify Analytics Events
Description
- Custom events logged to pinpoint do not appear.
- No errors are thrown and Amplify is correctly being configured.
- I am using Cognito for authentication and do not allow guests and unauthorised users to send analytics.
Categories
- [X] Analytics
- [ ] API (REST)
- [ ] API (GraphQL)
- [ ] Auth
- [ ] Authenticator
- [ ] DataStore
- [ ] Storage
Steps to Reproduce
- Create an amplify project with Cognito as the form of authorisation.
- Add amplify Analytics and do not allow guest/unauthorised users to send analytics
- Attempt to record a custom event.
Screenshots
No response
Platforms
- [X] iOS
- [X] Android
- [ ] Web
- [ ] macOS
- [ ] Windows
- [ ] Linux
Android Device/Emulator API Level
API 30
Environment
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.5.1 21G83 darwin-arm, locale en-ZA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.71.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Dependencies
Dart SDK 2.18.1
Flutter SDK 3.3.2
redux_comp 0.0.1
dependencies:
- amplify 0.0.1 [flutter amplify_flutter amplify_auth_cognito]
- amplify_analytics_pinpoint 0.6.8 [amplify_analytics_pinpoint_android amplify_analytics_pinpoint_ios amplify_core aws_common flutter meta]
- amplify_api 0.6.8 [amplify_api_android amplify_api_ios amplify_core amplify_flutter aws_common collection flutter meta plugin_platform_interface]
- amplify_auth_cognito 0.6.8 [amplify_auth_cognito_android amplify_auth_cognito_ios amplify_core aws_common collection flutter meta plugin_platform_interface]
- amplify_flutter 0.6.8 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios aws_common collection flutter meta plugin_platform_interface]
- amplify_storage_s3 0.6.8 [amplify_storage_s3_android amplify_storage_s3_ios amplify_core aws_common flutter meta plugin_platform_interface path_provider path]
- async_redux 15.0.0 [path_provider file weak_map fast_immutable_collections collection logging path flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_paystack 1.0.5+1 [flutter http intl meta async]
- general 0.0.1 [flutter image_picker async_redux carousel_slider redux_comp tradesman consumer]
- geolocation 0.0.1 [flutter amplify_api amplify_flutter http async_redux async redux_comp general tradesman uuid]
- geolocator 9.0.1 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- http 0.13.5 [async http_parser meta path]
- jwt_decode 0.3.1
- path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
- uuid 3.0.6 [crypto]
transitive dependencies:
- amplify_analytics_pinpoint_android 0.6.8 [flutter]
- amplify_analytics_pinpoint_ios 0.6.8 [flutter]
- amplify_api_android 0.6.8 [flutter]
- amplify_api_ios 0.6.8 [amplify_core flutter]
- amplify_auth_cognito_android 0.6.8 [flutter]
- amplify_auth_cognito_ios 0.6.8 [amplify_core flutter]
- amplify_core 0.6.8 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
- amplify_datastore_plugin_interface 0.6.8 [amplify_core collection flutter meta]
- amplify_flutter_android 0.6.8 [flutter]
- amplify_flutter_ios 0.6.8 [amplify_core flutter]
- amplify_storage_s3_android 0.6.8 [flutter]
- amplify_storage_s3_ios 0.6.8 [flutter]
- async 2.9.0 [collection meta]
- authentication 0.0.1 [flutter amplify_flutter async_redux redux_comp consumer general tradesman amplify]
- aws_common 0.1.1 [async collection http meta stream_transform uuid]
- carousel_slider 4.1.1 [flutter]
- characters 1.2.1
- clock 1.1.1
- collection 1.16.0
- consumer 0.0.1 [flutter async_redux flutter_pdfview path_provider image_picker uuid geolocation redux_comp amplify general tradesman authentication]
- cross_file 0.3.3+1 [js meta]
- crypto 3.0.2 [typed_data]
- fast_immutable_collections 7.4.1 [collection meta]
- ffi 2.0.1
- file 6.1.4 [meta path]
- file_picker 5.0.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
- flutter_pdfview 1.2.3 [flutter]
- flutter_plugin_android_lifecycle 2.0.7 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- geolocator_android 4.1.0 [flutter geolocator_platform_interface]
- geolocator_apple 2.2.1 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.0.6 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.1.1 [flutter geolocator_platform_interface]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- image_picker_android 0.8.5+2 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.1.8 [flutter flutter_web_plugins image_picker_platform_interface]
- image_picker_ios 0.8.5+6 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface]
- intl 0.17.0 [clock path]
- js 0.6.4
- json_annotation 4.6.0 [meta]
- logging 1.0.2
- material_color_utilities 0.1.5
- meta 1.8.0
- path 1.8.2
- path_provider_android 2.0.19 [flutter path_provider_platform_interface]
- path_provider_ios 2.0.11 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.6 [flutter path_provider_platform_interface]
- path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface]
- path_provider_windows 2.1.2 [ffi flutter path path_provider_platform_interface win32]
- platform 3.1.0
- plugin_platform_interface 2.1.2 [meta]
- process 4.2.4 [file path platform]
- sky_engine 0.0.99
- source_span 1.9.0 [collection path term_glyph]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- tradesman 0.0.1 [flutter file_picker uuid geolocation async_redux redux_comp general authentication consumer]
- typed_data 1.3.1 [collection]
- vector_math 2.1.2
- weak_map 2.0.4
- win32 2.7.0 [ffi]
- xdg_directories 0.2.0+1 [meta path process]
Device
iPhone 14 Pro Max
OS
iOS 16
Deployment Method
Amplify CLI
CLI Version
10.0.0
Additional Context
I have the latest stable versions of both flutter and the amplify packages
Amplify Config
''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "analytics": { "plugins": { "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "e3d9b8f064b34ac885cdf0565997698e", "region": "eu-west-1" }, "pinpointTargeting": { "region": "eu-west-1" } } } } }'''
Hi @MichaelDuPlessis - Can you share the code you are using to log the events so that we can attempt to reproduce this?
Hi @MichaelDuPlessis - Can you share the code you are using to log the events so that we can attempt to reproduce this?
final AnalyticsEvent event = AnalyticsEvent('CreateAdvert');
event.properties.addStringProperty('city','Pretoria');
event.properties.addStringProperty('province','Gauteng');
try {
await Amplify.Analytics.recordEvent(event: event);
await Amplify.Analytics.flushEvents();
} catch (e) {
debugPrint(e.toString());
}
Hi @MichaelDuPlessis - a few more questions:
- You mention using Cognito for authentication but it is not listed in your configuration. Just want to make sure you are adding and configuring that plugin.
- A user is logged in at the point you're recording events, correct?
@MichaelDuPlessis - If you are still facing an issue can you add the info requested above? Thanks.
@MichaelDuPlessis - I am going to close this issue out since we have not heard back. If you are still facing this an issue, please open a new request and include the info requested above. Thanks.