-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handbook: add customer ops data workflows page #2952
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
36541c1
Handbook: add customer ops data workflows page
attfarhan 91e4ec4
Update handbook/ops/bizops/customer_ops_data.md
attfarhan ed646f2
Update handbook/ops/bizops/customer_ops_data.md
attfarhan aff98a5
Update handbook/ops/bizops/customer_ops_data.md
attfarhan e5bf726
s/customer ops data/data workflows
attfarhan 7419f38
Merge branch 'fa/customer-ops-data' of github.com:sourcegraph/about i…
attfarhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# CustomerOps Data Workflows | ||
|
||
This document outlines the processes we have in place to pull data from our various third-party customer ops tools and get it into BigQuery and Looker for analysis. | ||
|
||
We extract data from our customer ops tools using several methods, described in more detail below. The methods we use currently include reading data into Google Sheets using data connectors (add-ons), writing Python scripts to query the tools' APIs, and create workflows in Zapier. | ||
attfarhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Google Sheets Add-Ons | ||
|
||
We use Google Sheets as a data store after pulling data from some of our customer ops tools. Once the sheets are created with the data we want, we connect them to BigQuery to create database tables. | ||
|
||
The add-ons we use depend on the data source. Currently, we use: | ||
|
||
- The [Google Analytics Spreadsheet Add on](https://developers.google.com/analytics/solutions/google-analytics-spreadsheet-add-on) to pull Google Analytics data. | ||
- [Data Connector for Salesforce](https://workspace.google.com/marketplace/app/data_connector_for_salesforce/857627895310) to pull Salesforce data. You should create a report in Salesforce containing the data you want, and then use this add on to pull data directly from the report. | ||
|
||
Both of these add-ons allow us to define the data we pull from our GA and Salesforce instances, and automatically refresh the data periodically. | ||
|
||
### Connecting the sheet to BigQuery | ||
|
||
Once the data we want is populated into a Google sheet, we can use it create a new table in BigQuery. In BigQuery, select the dataset you want to add the table to. For example, we have a dataset called `google_analytics` that contains our GA data. | ||
|
||
Then, click _Create Table_. In the configuration section, in the dropdown next to _Create table from_, select _Drive_, and _CSV_ as the file format. Then, copy and paste the Google Sheet URL containing your data into the URL field. BigQuery may be able to autodetect the schema, but if not, you will have to add each column name manually. You’ll also need to specify the number of header rows to skip to ensure your headers don’t get included as data.Then, create a table. | ||
attfarhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Once the table is created in BigQuery, you can create a view in Looker using the table as normal. | ||
|
||
_Note_: In order for BigQuery to query your sheet, you’ll need to share the sheet to a Google service account associated with the GCP project that the database is in. | ||
attfarhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Write a script | ||
|
||
We have Python scripts that fetch data via APIs and send that data into BigQuery. These scripts are run periodically via a CI pipeline. | ||
|
||
### HubSpot | ||
|
||
To pull data from HubSpot, we have Python scripts that pull in data using the HubSpot API and creates a table with the data in BigQuery. For example, we have a script that pulls in all of our [Contacts data](https://github.com/sourcegraph/analytics/blob/master/HubSpot%20ETL/get_contacts.py), and creates a corresponding table in BigQuery. This script is run via the [ETL script](https://github.com/sourcegraph/analytics/blob/master/HubSpot%20ETL/hubspot_etl.py), which is run every 24 hours via a [CI pipeline](https://buildkite.com/sourcegraph/analytics). | ||
|
||
## Zapier | ||
|
||
Sometimes, it may be easier to create an if-this-then-that workflow/Zap in Zapier than writing a script. Zaps can run code snippets, and update data in various places in response to certain events. For example, we have a [zap that runs whenever a new HubSpot form submission](https://zapier.com/app/editor/113508746) and updates a Google Sheet with new submissions. The Google Sheet is then used to create a table in BigQuery as above. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove the customer ops framing of this since we use these for lots of different reasons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And I won't go through and suggest on all the customer ops references but I think the same thing for all of them 😄)