Skip to main content

Embed Insights on Your Salesforce Account Profile


Embed Insights on Your Salesforce Account Profile

To embed an Insights Account Dashboard on your Salesforce Account Page:

  1. Ensure you have completed prerequisites:
  2. Create a new Visualforce Page in Salesforce.
    • In Salesforce, go to Setup.

    • In the Setup search box at top left, enter Pages.

    • Select the Visualforce Pages setup menu item.
      Screen Shot 2016-10-25 at 1.12.35 PM.png
    • At the top of the Visualforce Pages list, click the New button.
    • Complete the Visualforce Page Edit form as follows:
      • Label: Insights Account Profile
      • Name: Insights_Account_Profile
      • Description: Optionally enter anything you like here.
      • Available for Salesforce mobile apps: Leave unchecked.
      • Require CSRF protection on GET requests: Leave unchecked.
      • Visualforce Markup: Replace the sample code with the APEX code block provided by the Insights Salesforce Embed page pictured below (Go to: Settings > Salesforce Integration > Salesforce Embed and copy the code in the grey box).
        Screen Shot 2016-10-25 at 1.08.24 PM.png
      •  Click Save
  3. Add the Visualforce page you just created to your Salesforce Organization Account Page Layout.
    1. In Salesforce, go to Setup.
    2. Under App Setup, click Customize > Accounts > Page Layouts
      Screen Shot 2016-10-24 at 10.19.45 PM.png
    3. Click Edit for the Page Layout you are using on your Account pages
    4. Create a new Section to the page that will contain the Insights Embed
    5. Find the Visualforce page you just created from the menu and drag it to the new section.
    6. Edit the embedded page (using the wrench to the top right of the embed) to expand the height to 400 pixels. Save, and reload the page.
    7. After you are finished, you will have an embed like the one pictured below on your Salesforce Account pages.

      Screen Shot 2016-10-27 at 11.43.49 AM.png


Going Further

Since not all of your Salesforce accounts will have corresponding Insights accounts, it is recommended that you add conditional content into your Visualforce page that disables rendering of the Insights embed in cases where there isn't a matching salesforce_id. This will let you provide a custom error message that is relevant to your organization's use of Salesforce and Insights.

Below is an Apex code example:

<apex:page standardController="Account" cache="false">
<apex:outputPanel rendered="{!NOT(ISBLANK(account.mrr__c))}">
<apex:iframe height="400px"
<apex:outputPanel rendered="{!ISBLANK(account.mrr__c)}">
<p>This Account is not currently tracked in Zuora Insights.</p>

The above is based on creating a custom field in Salesforce called MRR__c whose values are synced from Insights using outbound data sync.