Erreur Google Analytics Production AWS


#1

Hello, locally Google Analytics works, but when I put on AWS, I have an error

Here is the code in my config.js

user: { metaData: { enabled: true, lastUsedAt: true, sessionsCount: true, createdAt: true, requestHistorySize: 4, devices: true, }, }, analytics: { // Configuration for generic tracking plugin GoogleAnalytics: { trackingId: ‘UA-18902XXX’, trackDirectives: true, // Optional enableAutomaticEvents: true, // Optional - set to false to disable trackEndReasons: false, // Optional - when set to true the custom metrics 1-6 are used to track endReasons sessionTimeoutInMinutes: 5, // Optional - default is 5 skipUnverifiedUser: true, // Optional - default is true }, // Configurations for platform-specific plugins GoogleAnalyticsAlexa: { trackingId: ‘UA-18902XXX’ }, },

Error log

{ "errorType": "TypeError", "errorMessage": "Cannot read property 'lastUsedAt' of undefined", "trace": [ "TypeError: Cannot read property 'lastUsedAt' of undefined", " at GoogleAnalytics.saveStartStateAndLastUsed (/var/task/node_modules/jovo-analytics-googleanalytics/dist/src/GoogleAnalytics.js:41:102)", " at Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:76:30)", " at Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:54:69)", " at App.handle (/var/task/node_modules/jovo-core/dist/src/core/BaseApp.js:203:46)", " at async App.handle (/var/task/node_modules/jovo-framework/dist/src/App.js:265:9)", " at async Runtime.exports.handler (/var/task/index.js:26:3)" ] }

Thanks for your help


#2

You need a database connection to make this work. Did you enable DynamoDB?


#3

Yes is it still does not work

{
“errorType”: “TypeError”,
“errorMessage”: “Cannot read property ‘route’ of undefined”,
“trace”: [
“TypeError: Cannot read property ‘route’ of undefined”,
" at AlexaSkill.Jovo_1.Jovo.getMappedIntentName (/var/task/node_modules/jovo-core/dist/src/plugins/Handler.js:462:41)",
" at GoogleAnalytics.getSessionTag (/var/task/node_modules/jovo-analytics-googleanalytics/dist/src/GoogleAnalytics.js:237:18)",
" at GoogleAnalytics.getPageName (/var/task/node_modules/jovo-analytics-googleanalytics/dist/src/GoogleAnalytics.js:215:32)",
" at GoogleAnalytics.getPageParameters (/var/task/node_modules/jovo-analytics-googleanalytics/dist/src/GoogleAnalytics.js:205:88)",
" at GoogleAnalytics.sendError (/var/task/node_modules/jovo-analytics-googleanalytics/dist/src/GoogleAnalytics.js:152:36)",
" at Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:76:30)",
" at processTicksAndRejections (internal/process/task_queues.js:93:5)",
" at async App.handle (/var/task/node_modules/jovo-core/dist/src/core/BaseApp.js:233:13)",
" at async App.handle (/var/task/node_modules/jovo-framework/dist/src/App.js:265:9)",
" at async Runtime.exports.handler (/var/task/index.js:26:3)"
]
}