Overview

The Mode Wordpress plugin allows you to easily White-Label Embed a Mode report into a Wordpress site.

Embed Mode Reports in WordPress

TIP: This User Switching plugin can help you quickly swap between user accounts in WordPress. This is handy for seeing what your users are able to see on each page, or for admins to switch between multiple accounts to manage reports.

Requirements

  • The Mode organization containing the target report must be on a paid plan that includes White-Label Embeds.
  • You must have a valid signature token for the organization that contains the target report. Ensure you have both the public access key and private access secret.
  • You must have administrative access to the Wordpress site where you want to embed the report.
  • Your Wordpress site must be part of a WordPress.com Business account or a WordPress.org account.

Implementation steps

1) Install the Mode WordPress plugin

Log-in to your WordPress dashboard to install the Mode Wordpress plugin:

  1. In the left navigation panel, click Plugins and then Add New.
  2. Search for Mode Analytics and the latest version will appear at the top of the list of results.
  3. Click Install Now.
  4. Wait for the installation to finish, then click Activate.

2) Input your Mode signature token

In the WordPress dashboard, go to Settings -> Mode Analytics. Paste your signature token Access Key and Access Secret into the plugin.

3) Add and configure the report embed

Click Add Report and fill in the following fields:

  • Max Age: An integer specifying the maximum allowable age, in seconds, that a cached report run’s results may be. If the report was last run more than the defined number of seconds ago, the report will rerun and return fresh results. Set to 0 to ensure the report runs every time the embed is viewed.
  • Report URL: Enter the report’s URL (e.g., https://modeanalytics.com/octan/reports/35c9sh5a174f/)
  • Embed Type: Select White-Label Embeds.
  • Short Code Report Name: Select a name to be used to embed this report.
  • Select Buttons (Optional): For White-Label Embeds, you have the option to allow CSV export and report filters (if defined in the report).

4) Configure parameters (if required)

On a report, click Add Parameters and fill in the following fields:

  • Parameter Slug: This should be consistent with the Parameters used in the report.
  • Data Types: Select the type of data input: text, number, or date.
  • Users Can Edit: This enables report viewers to select Parameters.
  • Default Value: Select which Parameter you would like viewers to see as the default.

5) Add the embed to a page

  1. On the left navigation panel, select Pages, and click New Page.
  2. Create a page title.
  3. In the content section, insert the Short Code Report name from your plugin settings: [mode-analytics report_name="Short Code Report Name"]
  4. Under Publish, select Preview Changes or view the page outside of the editor by clicking the Permalink

User tokens

With Mode’s WordPress plugin, admins can set up user authentication Parameters or tokens. You can create a custom attribute for each user’s profile that will dynamically replace the token (e.g., {{account_id}} in the Parameter default value field) when an embed is rendered. This will ensure that the user is shown the embed with the correct Parameters.

1) Create a user-specific token in WordPress

  1. Go to User Settings and then select a User Profile.
  2. Scroll to the bottom of the user profile page.
  3. Select Add Token.
  4. Create a unique token in the Token Name. We recommending creating one token per report.
  5. In Custom Value, enter the parameter value you intend to replace the token with. The parameter value should be specific to the user who is viewing the report. Make sure that the value you insert to substitute the token is the same value that you’ve assigned in your Mode report.

2) Add token parameter into a report in WordPress

  1. Go to Settings then Mode Analytics.
  2. In the Parameter section of the report, enter the following:
    • Parameter Slug: The same Parameter you used in the Mode Report.
    • Data Type: Select Text, as the Default Value will be the User Token you created above.
    • Default Value: The user-specific token name you created on the WordPress User Profile above.

Last updated May 17, 2018