Visualize Data and Insights Using Partner Intelligence Starter Pack

Kam Patel
AppExchange and the Salesforce Ecosystem
7 min readNov 10, 2021

As an AppExchange partner, you know App Analytics can provide data on how users interact with your solutions. And with more data comes greater opportunities, such as identifying attrition risks and informed decisions when it comes to feature development.

We’re excited to announce that AppExchange partners can now leverage the new “Bring Your Own Bucket” Pilot, which makes receiving and visualizing these insights faster and easier than before.

Thanks to my colleague Anika Teppo and Ben Easley for making it happen. Ben is an ISV Platform Expert who is responsible for Partner Intelligence. To request an AppAnalytics consultation with him, simply log a case through the partner community and choose “Customer 360 Platform Expert Consultation” as the SubTopic.

Important Disclaimers about the referenced technologies: 
PI (Partner Intelligence) Starter Pack and the CloudFormation stack are provided here as-is and as a reference guide. Please ensure that you understand the steps and security consideration of AWS.
App Analytics Delivery Config (Bring Your Own Bucket) is currently in pilot and therefore subject to change before it becomes Generally Available
This blog leverages new CRMA Athena connector which is in pilot and therefore subject to change before it becomes Generally Available
Implementing PIlabapp is a multi step process and ISV partner should read the documentation on AppAnalytics, know little bit of AWS and some knowledge of CRMA recipes is recommended (you can learn CRMA on trailhead).

Let’s dive into proper setup and how-to take advantage of this new perk.

Pre-Requisites to Note

  1. Make sure your partner business org (PBO/LMO) is enabled for the daily logs (Package Usage Log). If it is not enabled, please open a support case.

2. Open an expert case for App Analytics consultation with a request to enable the “Bring Your Own Bucket” pilot for your PBO org.

AWS Setup

First, let’s get AWS in a good place.

Pre-requisite: Use your existing AWS instance or sign up for a new AWS account.

Step 1: Install the Stack

Follow the instructions on the git repo here and install the stack

Step 2: Enable Bring Your Own Bucket from your PBO org

  • Log in to the License Management Org (LMO) that the package is registered to.
  • From Setup, enter App Analytics in the Quick Find box, then click App Analytics.
  • Click Delivery Config.
  • To create a package usage log, package usage summary, and a subscriber snapshot delivery config, click New Config and complete the required fields.

Bucket Name:

AWS IAM Role ARN:

Click Save

Step 3: Wait for a new date folder(s) in the byob bucket to show Up

This step could take up to a few hours. Once it’s there you can proceed to the next step. The data will help Glue to auto detect columns in the next step

Step 4: Run Glue Crawler

This is to detect the log table from S3 bucket’s test data.

  • In AWS, go to AWS Services → Glue.
  • Click on crawler, and run the crawler so it detects a table created from S3 bucket where daily log files are stored(name starting with pi-pibyobdailybucket*).
  • Wait for the status to be “Ready” and you should see one new table created.

Step 5: Create Athena queries

Now go to Query editor.

  • In AWS, go to Go to AWS Services → Athena → Athena query editor
  • Switch the workgroup to “PIbyobWorkgroup” as shown
  • Before you run your very first Athena query, you need to set up a query result location in Amazon S3. Select the existing bucket name starting with “pilabapp-piapppiathenaoutbucket***”

Select “pidb” database. Click on the three dots next to the table (near orange star) and preview the table

  • Create Views. Open the gist which has View definitions. Copy each View creation query (e.g. logins, entity) one by one. Replace the name of the table from “apps” to the Athena table name “pi-pibyobdailybucket*” as shown. Your table will be same as your full log bucket name “pi-pibyobdailybucket*”.

Preview the Views to make sure it shows the results.

Step 6: Create AWS Access Keys (for CRMAnalytics in next section)

  • Go to AWS → IAM and got to the user and generate access keys
  • Create an access key to be used in the next steps.

PBO Org: CRMAnalytics Setup

Now that AWS is in a good place, let’s move on to part two.

Pre-Requisites to Note

  • Make sure to enable CRMAnalytics in your PBO org and assign “Tableau CRM Platform Admin” licenses to the admin users.

Step 1: Connect CRMAnalytics to Amazon Athena

  • Go to Data Manager.
  • Click “New Connection”. Select the connection type “Athena”.
  • Enter values as per following guidelines
  • For “Connection Name” and “Developer Name” -> piathena
  • Enter AWS Access Key and Secret Key (this is from the AWS setup, step two).
  • For “AWS Region” use one the value based on your aws region

us-east-1 -> northernvirginia

  • For “Database” -> pidb
  • For “S3 Staging Directory” -> Use “Athena bucket name” from cloudformation stack creation
  • For “Datasource” → AwsDataCatalog
  • Click “Save and Test”

Step 2: Create Required Objects (One at a Time)

  • Click ‘Edit Objects’ on the drop-down of the “piathena” connection

Select “logins” view, select all fields. Click edit icon next to “distinct_users_token_num” and change the precision to 1 as shown. Click Save.

  • Repeat the process to create an object for each view you want to ingest data in.

On “piathena”, click on “Run Now” using the right drop-down arrow.

  • This will sync the data from Amazon Athena to CRMA objects
  • Optional: Set up a Schedule so this runs every 24 hours (or whatever you like) daily as per documentation.

Step 3: Install PI starter labapp in Your PBO Org

Install this app in your PBO org. it has CRMA recipe/dashboards.

Step 4: Test & Schedule the Recipes to Create Datasets

In the Data Manager, go to the Recipes tab.

  • On “pistarter-athena-to-crma-ingest”, click “ Run now” which will create the datasets.
  • Go to Jobs Monitor to check the status.
  • Wait till you see following datasets in the “PI Starter Plus” app

Step 8: Validate the Dashboards and Datasets

  • Go to “PI Starter Plus” app and check out the dashboards.

Step 9 (Optional): Add the Dashboards in the new Lightning App Builder Pages as Shown in the Test Drive

Pushing CRM Analytics to Slack Channels (Optional)

Looking for a way to keep others informed? You can push CRM Analytics dashboards to Slack channels every day with the upcoming Slack CRMAnalytics app (beta).

Setup

Under Setup, Enable slack in Salesforce org.

Under Setup, Enable “CRM Analytics for Slack”

Follow this article to create permission set with required permissions and assign it to the admin user (you in this case).

Sign up for a free Slack workspace (if you don’t have an existing Slack workspace).

Go here and click “ADD THE CRM ANALYTICS FOR SLACK APP”. Follow the prompt and connect the Salesforce org.

  • You should see CRMAnalytics Dashboards when you run the Slack command “/analytics-recents”. Click on the three dots against the dashboard and get a snapshot! Go ahead and subscribe to the dashboards for a daily push to your Slack channels.

Summary

And there you have it! We enabled AWS for Bring Your Own Bucket, connected Salesforce CRMAnalytics to the Amazon Athena, and installed an unmanaged package with recipes and dashboards. This solution is incredibly flexible and easy to extend with additional Athena views and CRMAnalytics dashboards.

--

--

Kam Patel
AppExchange and the Salesforce Ecosystem

Hello! I work at Salesforce as a technical expert for ISV partners. I love going for long walks, socializing, public speaking and teaching kids in rural areas.