xingtwittersharerefreshplay-buttonpicture as pdflogo--invertedlinkedinkununuinstagram icon blackShapeGroup 3 Copy 2Group 2 Copydepartment_productdepartment_datascienceuserclosebasic clockblogShapearrows slim right copy 3arrows slim right copy 3arrows slim right copy 3

ALEXA Google Analytics Skill

|

14. Juni 2017 |

- min Lesezeit

ALEXA Google Analytics Skill
Since last ALEXA Voice Meetup with Liz Meyers we were very enthusiastic about the whole speech issue. While searching for a relevant ALEXA skill which is capable of simplifying workflows in daily business the idea came up to facilitate meetings with ALEXA. In fact we use account linking to retrieve data from Google Analytics. But what's this skill good for? And how was our approach?

As meetings can turn out to be very boring listening sessions with limited interaction we aimed to spice things up by letting ALEXA do the reporting job. With that goal we want to create a more conversational environment for business meetings when it’s all about dry figures and results.

Account linking

First thing you would need to accomplish is the account linking configuration within your Amaazon Developer Account. The configuration menu provides a section called “Account Linking”. There you can set up several preequisites:

  • Authorization URL: Choose a oAuth provider to handle the login process
  • Client Id: Represents the Id of your web service
  • Scope: Limit access rights for ALEXA, e.g. read-only
  • Authorization Grant Type: Implicit Grant will get the access token only once, while Auth Code Grant will allow ALEXA to ask for new access token when needed

The user flow then is as simple as following: by activating Web Analytics Assistant the user will be prompted to select a google account if there’s more than one. By successfully entering your credentials you are done and ready to interact with ALEXA.

Asking for metrics

After a short welcoming and introduction message, ALEXA will guide you through a picker dialog to define a google analytics view from which metrics will be asked. This dialog is realized by looping through existing accounts and properties till we reach the desired view. Each time user says “yes” the current id will be saved in order to create a correct API request call on Google Analytics API.

Whenever a specific view has been selected, users can ask for metrics like revenue, channel distribution and sessions.

  • “Alexa, how was our channel distribution?”
  • “Alexa, I’m interested in our revenue”
  • “Alexa, tell me about sessions on my site”

In all cases we retrieve data from the linked Google Analytics account by requesting corresponding API. Required parameters are being stored in this.attributes variable. However we also integrated a DynamoDB which is provided by the ALEXA SDK automatically. This way we can store persistent data for example your last settings for account-property-view. When you re-enter the skill it will start from that point - no need to do the settings again.

Change settings

In case you would like to get metrics from another account, you can easily change your settings with

  • “Alexa, change my settings please”
  • “Alexa, change view”
  • “Alexa, change my account”

A changeIntent will handle user input depending on given setting slots: account, property, view.

Get it now and try it out!

Web Analytics Assistant is available in the ALEXA Skill Store - for free! It’s really fun to use it and we love to have ALEXA with us in our weekly business meetings.

If you are having trouble using the skill, please don’t hesitate to contact us or have a look on our Web Analytics Assistant Website. We are happy to assist. Furthermore we appreciate your feedback on user experience or missing features to make this skill a perfect fit for your needs.

Stay tuned for upcoming versions with new features!


Ähnliche Artikel

Ähnliche Artikel