Step 3: Configure API Request Information
Now you need to configure your API request information in the API Connector Add-on in Google Sheets.
- For the API method, select ‘POST’ - this will ensure that analytics will be pulled from the Yext platform to your Google Sheets page.
- Under ‘API URL path’, insert the following URL:
https://api.yextapis.com/v2/accounts/me/analytics/reports?api_key=[INSERT_API_KEY]&v=20210415
- Where the URL says “INSERT_API_KEY”, replace this with the API key you generated in Step 2. This will ensure that this POST request is linked to the correct Yext account.
- Under ‘OAuth’, you will keep the selected authentication as “None”.
- Under ‘Headers’, use “Content-Type” as the ‘New key’, and “application/json” as the ‘Value’.
Under ‘Request body’, insert the following line of code:
{ "metrics": [ "[INSERT_METRICS]" ], "dimensions": [ "[INSERT_DIMENSIONS]" ], "filters": { "[INSERT_FILTERS]" } }
Where the request body says
INSERT_METRICS
, replace this with metrics you are looking to pull from the Yext platform. For example, for Page views and clicks, you may select “STOREPAGES_PAGEVIEWS”,”STOREPAGES_CALLTOACTIONCLICKS”.Where the request body says
INSERT_DIMENSION
, replace this with the dimensions you are looking to break down your data. For example, if you are looking to pull the Entity IDs and page URLs, selectENTITY_IDS
,STOREPAGES_PAGE_URL
.Where the request body says
INSERT_FILTERS
, replace this with the filters you are looking to narrow the scope of what data is actually pulled. For example, if an account uses Pages, Search, and Listings, but you are only interested in the data for Pages, selectPRODUCT”:”PAGES
.Under ‘Destination sheet’, select ‘Set current’ so that the data will be pulled into the current sheet, and select cell ‘A1’.
Finally, name your API Connector so that you can re-run this pull on a regular cadence.