Skip to main content

Insights & Recommendations on Custom Objects

The Showpad Insights and Recommendations app is a robust tool that enables you to view:

  • all logged Showpad activity as Insights information insights

  • relevant Showpad content as Recommendations recommendations

As a Salesforce administrator, you can embed our app on specific object layouts to display a timeline of Showpad share and engagement insights and view relevant content recommendations. Straight out of the box, we support Salesforce's four default objects (contact, account, opportunity, lead), as well as any custom and non-sales objects.

TL;DR
  • Custom object insights? Create an Apex controller extension with your email logic
  • Custom object recommendations? Create a Visualforce page with the standard controller
  • Both? Combine both approaches in a single Visualforce page
Insights and Recommendations Access

The app will only surface results for Salesforce users also present in the Showpad organization.

Insights logic

note

Generally the Salesforce default objects and recipient logic do not require modification. The information provided here is specifically about custom objects and/or email recipients logic for embedding the Showpad Insights & Recommendations app.

The Showpad Insights widget is a Canvas App embedded in a Visualforce Page with the relevant StandardController (which has a parameters property that can be modified). The widget is populated with share and engagement information based on relevant email addresses. For example, a sales rep initiates a Showpad email share to a designated recipient. Showpad Insights then surfaces that share and its engagement on relevant objects.

The default logic for determining the relevant email addresses is defined in the included Apex controller extension of the Showpad for Salesforce package:

Salesforce ObjectDefault Email Address Logic
AccountThe email addresses of account contacts are used.
OpportunityThe email addresses of contacts added in opportunity roles are used.
ContactThe email addresses (default field) of the contacts are used.
LeadThe email addresses (default field) of the leads are used.

As a Salesforce developer/admin you can create your own Apex controller and Visualforce page to:

  • Override the default logic on any of the standard objects
  • Embed the Showpad Insights timeline on any custom Salesforce object

Recommendations logic

Showpad admins can configure recommendation rules using all types of Salesforce fields (including text, multi-value, picklist, etc.) and fields on related or child objects (for example, products related to the opportunity). These rules link the tags of your assets with the Salesforce fields. Showpad content with the linked tag will be recommended when certain Salesforce criteria are met.

Recommended assets are presented to sellers ordered first by the number of matching rules and secondarily by the most recently updated date.

Configuration

Sandbox first

Test all customizations in a Salesforce sandbox or Developer Edition before deploying to production.

Prerequisites

To customize insights, you must have:

1. Apex Class - Controller Extension (Insights only)

To surface Showpad insights based on relevant email addresses, you need an Apex class with a controller extension that assigns the email addresses to the Showpad Visualforce page (created in step 2).

A core element in the Apex class for you to modify is the specific Salesforce Object Query Language query that fetches relevant email addresses related to your custom object.

  1. In Salesforce, click the gear icon and select Setup.

    Setup

  2. Navigate to Custom Code > Apex Classes and click New.

    New Apex Class

  3. Update the following code with your own information and paste it into the Apex Class tab:

    public with sharing class CustomObjectShowpadExtension {
    public String customRecipientEmails {get;set;}

    public CustomObjectShowpadExtension(ApexPages.StandardController controller) {
    String currentRecordId = controller.getRecord().Id;

    // adjust with your own logic, object and fields
    Custom_Object__c myRecord = [SELECT Name, Id, Email_for_Showpad_Insights__c FROM Custom_Object__c WHERE Id=:currentRecordId LIMIT 1];

    // note that this can also be a comma-separated list of multiple relevant emails
    customRecipientEmails = myRecord.Email_for_Showpad_Insights__c;
    }
    }

    Apex Class code

    Notes about naming
    • Apex Class - Note the name you give to your class. You'll need to reference it in the next step.
    • Visualforce page variable - Do not use recipientEmails as the variable name. It conflicts with the Controller Extension included in the standard package and could result in an empty value.
  4. Click Save.

controller

2. Visualforce Page

Create a new Visualforce page with a standardController on your object to allow the Showpad Insights and Recommendations app to be embedded on that record’s detail layout.

  1. Navigate to Custom Code > Visualforce Pages and click New.

    New Visualforce Page

  2. Enter a Label and Name for the page (e.g., showpad_app_custom_object), then replace the default code with one of the examples below.

    Visualforce page

Example (Recommendations only)

<apex:page standardController="Custom_Object__c" extensions="ShowpadForSF.ShowpadWidgetControllerExtension">
<apex:canvasApp
developerName="showpad_canvas_app"
parameters="{domain:{{subdomain}}, application: 'crm-widget'}"
entityFields="Id,Name"
width="100%"
maxHeight="infinite"
scrolling="auto"
height="100%"
/>
<apex:include pageName="ShowpadForSF__showpad_app_widget_sizing_logic" />
</apex:page>

Example (Insights and Recommendations)

<apex:page
standardController="Custom_Object__c"
extensions="ShowpadForSF.ShowpadWidgetControllerExtension,CustomObjectShowpadExtension"
>
<apex:canvasApp
developerName="showpad_canvas_app"
parameters="{
domain:{{subdomain}},
application: 'crm-widget',
recipients: '{!customRecipientEmails}'
}"
entityFields="Id,Name"
width="100%"
maxHeight="infinite"
scrolling="auto"
height="100%"
/>
<apex:include pageName="ShowpadForSF__showpad_app_widget_sizing_logic" />
</apex:page>
caution

Replace {{subdomain}} with your own Showpad subdomain.

Insights only

To surface insights without recommendations, include the showRecommendations: false property in the parameters object. See the Advanced Customization section in the Help Center.

3. Embed on Record Layout

Embed your Visualforce page on the custom object’s detail layout. The following example is for a custom tab on a Lightning page.

  1. From the gear icon, select Edit Page, then add a Visualforce component.

    Embed on layout

Was this page helpful?