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
-
relevant Showpad content as 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.
The app will only surface results for Salesforce users also present in the Showpad organization.
Insights Logic
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 initiaes a Showpad email share to a designated recipient. Showpad
Insights then surfaces that share and its engagement on relevant objects.
The default logic of determining the relevant email addresses is defined in the included Apex controller extension of the Showpad for Salesforce package:
Salesforce Object | Default Email Address Logic |
---|---|
Account | The email addresses of account contacts are used. |
Opportunity | The email addresses of contacts added in opportunity roles are used. |
Contact | The email addresses (default field) of the contacts are used. |
Lead | The 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 relevant 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
The customizations described here must be performed in a Salesforce sandbox or Developer Edition before being deployed to production.
To customize insights, you must have:
- Ultimate subscription to Showpad
- Connected your Salesforce organization to your Showpad account,
- Installed the Showpad for Salesforce app,
- Configured Showpad's Insights and Recommendations app and Visualforce pages,
- Experience with Visualforce and Apex.
1. Apex Class - Controller Extension (Insights only)
In order 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.
-
From the gear icon, select Setup:
-
Expand the Custom Code menu in the left navigation, select Apex Classes and click the New button:
-
Update the following code with your own information and paste it into the new 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;
}
}Notes about naming-
Apex Class - Be sure to note the name you give to your class. You'll need to reference it in the next step.
-
Visualforce page variable - Be careful not to use
recipientEmails
as the name of this variable. It could result in an empty value due to a conflict with the Controller Extension included in our standard package.
-
-
Click the Save button
2. Visualforce Page
Next, you need to create a new Visualforce page. This page must have a standardController
on an object in order to
allow the Showpad Insights and Recommendations app to be embedded on that record’s detail layout. The following
instructions use the name, showpad_app_custom_object
.
-
In the Custom Code menu of the left navigation, select Visualforce Pages and click the New button:
-
Enter a Label and Name for the new page, and replace the default code in the Visualforce Markup tab with the code in the following examples.
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>cautionBe sure to replace
{{subdomain}}
with your own Showpad subdomain.tipIf you want to only surface insights (i.e., without recommendations), you can include the
showRecommendations: false
property in theparameters
object, as described in the Advanced Customization section in this Help Center article.
3. Embed on Record Layout
The last step is to embed your newly created Visualforce page on the custom object’s detail layout. The following example is for a custom tab on a Lightning page.
-
From the gear icon, select Edit Page, then add a Visualforce component to it: