If you have multiple levels of accounts (parent accounts on top of child accounts), you can pass this additional information to Pendo in the install script.
Prerequisites
A separate parent account subscription setting must be enabled by your Pendo account representative. You can request this by emailing success@pendo.io or contacting Pendo Support.
Important considerations
Before you implement this feature, read the following information carefully to make sure this is the right setup for your organization.
Merging data
The structure of this change isn't just adding on an additional object linked to the account object. The Account ID is replaced with a parent Account ID prepended to a child Account ID, in the format ParentAccountID::childAccountID. This string is created from your Account ID and parent Account ID designations in the install script, which you can find an example of at the end of this article.
Because of this structure, if you decide to turn off parent accounts and start passing in just the child Account ID, you won't be able to merge with the data that also had those same child Account IDs if they were linked to parent accounts. You must instead create a new set of Account IDs.
Data visibility
In Pendo, by default, you have a Visitors page and an Accounts page, which list all of your visitors and accounts respectively. With parent accounts turned on, when you navigate to the Accounts page in Pendo, the default is Parent Accounts, giving you limited visibility into account (mid-level) metrics.
We currently don't offer an in-app view of accounts and parent accounts with all metrics. You can create account reports to look into account-level metrics, but you won't get the same charts and graphs for Accounts in Pendo.
This structure means that the dashboard widgets that are set to calculate on account-based data pull in data for the combination of ParentAccountID::ChildAccountID.
Install script structure
The structure of the install script with multiple levels of accounts looks as follows. We recommend copying the install script from the Install Settings tab of your application settings because this already includes the correct API key. What follows is a generic install script that needs to include your actual API key.
<script>
(function(apiKey){
(function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[];
v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w<x;++w)(function(m){
o[m]=o[m]||function(){o._q[m===v[0]?'unshift':'push']([m].concat([].slice.call(arguments,0)));};})(v[w]);
y=e.createElement(n);y.async=!0;y.src='https://cdn.pendo.io/agent/static/'+apiKey+'/pendo.js';
z=e.getElementsByTagName(n)[0];z.parentNode.insertBefore(y,z);})(window,document,'script','pendo');
// Call this whenever information about your visitors becomes available
// Please use Strings, Numbers, or Bools for value types.
pendo.initialize({
visitor: {
id: 'VISITOR-UNIQUE-ID' // Required if user is logged in
// email: // Optional
// role: // Optional
// You can add any additional visitor level key-values here,
// as long as it's not one of the above reserved names.
},
account: {
id: 'ACCOUNT-UNIQUE-ID' // Highly recommended
// name: // Optional
// planLevel: // Optional
// planPrice: // Optional
// creationDate: // Optional
// You can add any additional account level key-values here,
// as long as it's not one of the above reserved names.
},
parentAccount: {
id: 'PARENT-ACCOUNT-UNIQUE-ID'
// name: // Optional
// You can add any additional master account level
// key-values here.
}
});
})('ACTUAL_API_KEY_HERE');
</script>
Parent accounts for mobile
Parent accounts can work for mobile applications as well.
As with web applications, a Pendo admin must first need to check the box for Parent Accounts within your subscription settings.
When you set the Account ID in the Pendo SDK initialization, use the following format to set a parent Account ID as well: ParentAccountID::ChildAccountID.
You can't currently set metadata for the parent account through the mobile SDK.