Data Sync allows you to send account and visitor metadata directly from Pendo to your preferred cloud storage destination. From there, it can be automatically pulled into your centralized data lake or warehouse on a regular cadence.
Account and visitor exports are independent data types that are different from events and are applicable at the subscription level. You can export accounts, visitors, or both. Account and visitor exports are delivered to their own subfolders within the storage destination you configure for Pendo Data Sync. You can choose to create one-time exports or ongoing metadata updates, which send an initial export of all metadata followed by a daily export for any accounts or visitors whose metadata was updated within the previous 24 hours.
This article is written to help you understand the flow of account and visitor exports in Data Sync and to prepare you for implementation. Specifically, this article:
- Outlines prerequisite steps.
- Explains the flow and frequency of exports.
- Clarifies the hierarchy and purposes of files contained within an export.
- Details how to load an export into your data lake or warehouse.
Prerequisites
- Data Sync configured with a destination. For more information, see:
- Ability to use data warehouse destination commands or SDK to create and load tables from an Avro file source.
Create account and visitor exports
After setting up your destination, Data Sync customers can create one of two types of account and visitor exports:
- A historical One-time export, which exports all accounts or visitors in your subscription at the time of the export.
- An Ongoing metadata updates export, which exports all accounts or visitors in your subscription that have been updated in the last 24 hours. This export runs every day to export updated metadata for the previous 24 hours.
Note: If Data Sync isn't yet included in your Pendo subscription, you can create a one-day Test export instead, which is available as a trial feature. For more information, see Overview of Pendo Data Sync. You can only export event data as part of the trial.
If your subscription has more than one Data Sync destination, select the destination you want to use before creating the export. Exports are managed separately for each destination.
To create a one-time export:
- Go to Settings > Data Sync. If you have more than one destination, select the destination at the top of the page. Then select Create one-time export. The create export flow uses the selected destination and doesn't ask you to choose it again.
- In the screen that opens:
- Enter a meaningful name.
- Choose Accounts and visitors as the data type.
- Choose a data level: Accounts or Visitors.
- Select Next: Export Summary.
- Check the summary and then select Create export.
To send ongoing metadata updates instead, turn on the Account data or Visitor data data product for the destination. For the steps, see Manage recurring account and visitor exports in this article.
Each export is delivered to the bucket URL and path provided in the destination configuration. For example, if the following path is used, gs://pendo-data/abcde, Pendo creates a datasync folder at gs://pendo-data/abcde/datasync. Exports are delivered to a subfolder named after the exported entity's data level. In this example, each account export would be added to a subfolder under gs://pendo-data/abcde/datasync/<subscription-id>/accounts and each visitor export would be added to a subfolder under gs://pendo-data/abcde/datasync/<subscription-id>/visitors.
Load account and visitor exports
The following information is needed to successfully load Pendo account and visitor data from your cloud storage destination into your data lake or warehouse.
Because account and visitor metadata are subscription-level data, Pendo creates separate folders for accounts and visitors inside the subscription folder. Inside these subscription-level subfolders (one for accounts and one for visitors), there is:
-
An export manifest (
exportmanifest.json), which is updated after an export completes. -
A unique hashed folder (
export-uuid) consisting of a bill of materials file for that export, and Avro files containing the exported data.
File names alone don't fully explain their contents, and so it's also important to understand:
- The structure of exports. See Account export file hierarchy and Visitor export file hierarchy.
- The purpose of the files in an export. For explanations of each exported file, see File descriptions. For more information about the data included in exported files, see Data Sync schema definitions.
File hierarchies
The following sections provide an overview of the structure of files included in an account export and a visitor export. For more details about the information contained in these files, see File descriptions in this article, and the Data Sync schema definitions article.
Account export file hierarchy
gs://pendo-data/datasync/<subscription-id>/accounts/
├── exportmanifest.json
└── <export-uuid>/
├── billofmaterials.json
├── accounts.avro
├── metadataschema.avro
└── <export-uuid>/
├── ...If you have a large volume of accounts in your subscription, you might receive multiple account files in the following format: accounts-000.avro, accounts-001.avro, and so on.
Visitor export file hierarchy
gs://pendo-data/datasync/<subscription-id>/visitors/
├── exportmanifest.json
└── <export-uuid>/
├── billofmaterials.json
├── visitors.avro
├── metadataschema.avro
└── <export-uuid>/
├── ...If you have a large volume of visitors in your subscription, you might receive multiple visitor files in the following format: visitors-000.avro, visitors-001.avro, and so on.
Unique identifiers
You can extract more information about the subscription from Pendo’s Aggregations API using the unique identifier in the path at the top of the hierarchy: subscription-id.
A folder of account or visitor data, which is named according to the unique export identifier, exists at the same level in the hierarchy as the export manifest (exportmanifest.json).
Export management files
There are two lists of export contents:
-
The export manifest (
exportmanifest.json), which is a concatenated list of daily bills of materials. For more information, see Export manifest in this article. - The daily bill of materials (
billofmaterials.json) within the individual export, which is the JSON representation of the export's contents used by ETL automation to load exported Avro files into a data warehouse or data lake. For more information, see Bills of materials in this article.
Account files
The contents of the account export exist inside an accounts file. For smaller volumes of accounts, this information is stored in accounts.avro. Subscriptions with a large volume of account exports might be split into multiple account files, named in the following format: accounts-000.avro, accounts-001.avro, and so on.
The following code example shows what an entry in an account file might look like:
{
"agent_name": "Acme Corp",
"agent_plan": "enterprise",
"firstvisitMS": 1659627208875,
"idhash": 5419074444,
"id": "accountId123",
"lastupdatedMS": 1659627209099,
"lastvisitMS": 1659627208875,
"custom": "{\"myCustomField\": \"test\"}",
"salesforce": "{}"
}Fields from the agent metadata group are flattened into agent_<fieldname>. Other metadata groups, like custom metadata or groups populated by integrations, are condensed into a single JSON-encoded string. The metadata schema file includes the names and types of each field included. For more information about the account file's schema definition, see Data Sync schema definitions.
Visitor files
The contents of the visitor export exist inside a visitor file. For smaller volumes of visitors, this information is stored in visitors.avro. Subscriptions with a large volume of visitor exports might be split into multiple visitor files, named in the following format: visitors-000.avro, visitors-001.avro, and so on.
The following code example shows what an entry in a visitor file might look like:
{
"agent_email": "testUser@pendo.io",
"agent_firstname": "test",
"agent_full_name": "test user",
"agent_lastname": "user",
"agent_user_job_role": "developer",
"lastbrowsername": "Chrome",
"lastbrowserversion": "89.0.4328",
"lastservername": "local.pendo.io:3000",
"accountid": "account1",
"firstvisitMS": 1659627208875,
"idhash": 5419074444,
"id": "visitorId123",
"accountids": [
"account1"
],
"lastupdatedMS": 1659627209099,
"lastuseragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4_0) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/7.7.0 Chrome/89.0.4328.0 Electron/12.0.0-beta.14 Safari/537.36",
"lastoperatingsystem": "Mac OS X",
"lastvisitMS": 1659627208875,
"custom": "{\"myCustomField\": \"test\"}",
"pendo_hubspot": "{\"record_id\": 12345}",
"salesforce": "{}"
}Fields from the agent metadata group are flattened into agent_<fieldname>. Other metadata groups, like custom metadata or groups populated by integrations, are condensed into a single JSON-encoded string. The metadata schema file includes the names and types of each field included. For more information about the visitor file's schema definition, see Data Sync schema definitions.
Note: accountids lists every account the visitor belongs to. accountid is a single representative value from that list with no ordering or recency guarantee. To resolve visitor-to-account relationships, use accountids.
Metadata schema file
Each export includes a metadataschema.avro file, which contains the export file's schema. Use it to ensure that the metadata can be properly imported into your ETL tool. For the fields in this file, see Metadata schema fields in Data Sync schema definitions.
File descriptions
The following table provides a description of the files contained in an export. For more information about the data included in exported files, see Data Sync schema definitions.
The file names are relative. An absolute file name can be obtained by prepending the rootUrl field from the export manifest to the relative file name. The rootUrl also corresponds to the path of the billofmaterials.json file (excluding its filename).
| Content type | File name | Description |
| Export management file: Record of files over several exports, plus some metadata. | exportmanifest.json |
Contains a concatenated list of files for each part of the daily export, covering a rolling window of exports generated within the last 30 days. The counter iterates with each new export received; zero (0) means there's nothing to do and the content can be deleted. |
| Export management file: Record of export contents. | billofmaterials.json |
A JSON representation of the export contents. This is used by ETL automation to load exported Avro files into a data warehouse. |
| Account file. | accounts.avro |
Contains the account metadata export. |
| Visitor file. | visitors.avro |
Contains the visitor metadata export. |
| Metadata schema file. | metadataschema.avro |
Contains the export's schema. |
Bills of materials
The bill of materials documents the contents of the export.
Account export's bill of materials
The following code snippet is an example of what the billofmaterials.json looks like for an account Data Sync export.
{
"timestamp": "2023-02-16T20:21:11Z",
"numberOfFiles": 65,
"subscription": {
"displayName": "ACME CRM",
"id": "6591622502678528"
},
"accounts": {
"count": 243,
"files": [
"accounts.avro"
]
},
"metadataSchemaFile": [
"metadataschema.avro"
],
"exportType": [
"One-time"
],
"dataLevel": "account"
}
exportType can be one of the following:
["One-time"]if the export is a one-time export.["Ongoing metadata updates"]if the export is an ongoing metadata updates export.
In the accounts section:
countis the number of accounts exported.filesis the list of files that contain the exported accounts. If multiple files are sent, they are namedaccounts-000.avro,accounts-001.avro, and so on.
If no accounts are exported, the accounts section isn't present.
Visitor export's bill of materials
The following code snippet is an example of what the billofmaterials.json looks like for a visitor Data Sync export.
{
"timestamp": "2023-02-16T20:21:11Z",
"numberOfFiles": 65,
"subscription": {
"displayName": "ACME CRM",
"id": "6591622502678528"
},
"visitors": {
"count": 243,
"files": [
"visitors.avro"
]
},
"metadataSchemaFile": [
"metadataschema.avro"
],
"exportType": [
"One-time"
],
"dataLevel": "visitor"
}
exportType can be one of the following:
["One-time"]if the export is a one-time export.["Ongoing metadata updates"]if the export is an ongoing metadata updates export.
In the visitors section:
countis the number of visitors exported.filesis the list of files that contain the exported visitors. If multiple files are sent, they are namedvisitors-000.avro,visitors-001.avro, and so on.
If no visitors are exported, the visitors section isn't present.
Export manifest
Visitor and account exports are managed by separate export manifests.
The export manifest is a key file for reading and ingesting exports. The export manifest is a concatenation of multiple bills of materials, with some additional metadata. It consists of a rolling record of the past 30-day period of Data Sync activity, regardless of which dates of data are exported.
While the bill of materials provides details of everything in a single export, the export manifest operates at a higher level, allowing you to keep track of what’s happening with all of your exports over time. This allows you to iterate through the counters.
The following code snippet is an example of what the exportmanifest.json looks like for a Data Sync export, excluding parts that overlap with the billofmaterials.json.
{
"exports": [
{
// complete billofmaterials object present but omitted for brevity
"exportType": [...],
"counter": 1,
"finishTime": "2023-03-03T14:10:15.311651Z",
"storageSize": 12130815,
"rootUrl": "gs://pendo-data/datasync/6591622502678528/accounts/0f39bdf6-09c2-4e4d-6d4f-b02c961d8aaf"
},
{
// complete billofmaterials object present but omitted for brevity
"exportType": [...],
"counter": 2,
"finishTime": "2023-03-03T14:20:12.9489274",
"storageSize": 23462682,
"rootUrl": "gs://pendo-data/datasync/6591622502678528/accounts/b979502c-1a01-4569-74cf-e4a7f5049d8f"
}
],
"generatedTime": "2023-03-05T04:17:59.853205005Z"
}The export manifest only reflects exports and the subsequent files that have been completely loaded into your cloud storage. There's never a partial export in the export manifest. An export listed in the export manifest is always a complete export.
Updates to exported data
Ongoing metadata updates include updates to metadata that have been previously exported. Your ETL process should include the appropriate "drop and replace" logic to ensure that a duplicate account (Account ID) or visitor (Visitor ID) isn't accidentally ingested.
Example load flow
This example creates a separate table in the data warehouse for each file type. You can load data to suit your needs as long as the data is replaced correctly.
Step 1. Read the most recent export manifest
Read the most recent exportmanifest.json file to find all unprocessed exports since the last time data was loaded. You can use the counter field as a marker for load progress.
Step 2. Iterate over each entry in the exports list
Cycle through the entries in the list to process the entries and load them into a table.
The latest version of the Pendo metadata schema file is sent in each export. When loading these files into your data warehouse, you must ensure that you replace the previous file with each export and use logical Avro type mapping.
Load metadataschema. If the metadataschema table doesn't exist, create it. If the metadataschema table exists, drop all data, then load the file listed in metadataSchemaFile.
Step 3. Iterate over accounts or visitors
Load each account or visitor file from the list in either the exportmanifest.json file or the export's billofmaterials.json with logical type mapping. If the account or visitor table doesn't exist, create it. To avoid duplication, if the account or visitor table does exist, drop any account or visitor metadata for the given Account ID or Visitor ID from the table and append data from the account or visitor file to the account or visitor table.
View account and visitor exports
To check account and visitor exports, go to Settings > Data Sync. If you have more than one destination, first select the destination at the top of the page. On the Data products tab, the Account data and Visitor data rows show the Status of each ongoing export and when it Last synced. To see sync history for the destination, open the Sync activity tab. For more information, see Overview of Pendo Data Sync.
Manage recurring account and visitor exports
Ongoing metadata updates are managed as the Account data and Visitor data data products. To turn one on or off:
- Go to Settings > Data Sync and, if you have more than one destination, select the destination you want to manage at the top of the page.
- On the Data products tab, select Account data or Visitor data.
- In the panel that opens, use the toggle to turn the data product on or off, then select Save changes.
- Review the summary, then select Save changes again to confirm.
When you turn on a data product, the first export includes existing data and future exports keep it updated. When you turn one off, ongoing exports to that destination pause and previously delivered data is kept. A data product that is off displays Disabled in the Status column. One that is on with no completed export yet displays Waiting for first sync.