A middleware to track salespeople's goals on Hubspot, within Google Sheets. (Made before the official Hubspot Goals object was introduced)
The project consists of several Google Apps Script files:
Main.gs
: Contains main functions for managing triggers, handling goal additions, and performing daily checks.Get_data.gs
: Handles data retrieval from the HubSpot API, such as fetching deals associated with goals.TriggerHandler.gs
: Manages trigger setup, arguments, and deletion.
To use this project, you'll need:
- A Google account
- Access to Google Sheets
- HubSpot API key
- Create a new Google Sheets document.
- Open the Script Editor by navigating to
Extensions > Apps Script
. - Copy and paste the code from each
.gs
file into the Script Editor. - Save the project with a name of your choice.
- Configure the HubSpot API key.
Before using this project, set up a HubSpot workflow to write each newly added goal to the Google Sheets document as a new row. This ensures that the goalAdded()
function is triggered whenever a new goal is added in HubSpot.
Additionally, set up a manual trigger to run the goalAdded()
function each time a new row is added to the "Goals" sheet in your Google Sheets document. This manual trigger is necessary to initiate goal tracking.
- Add goals to the "Goals" sheet in your Google Sheets document.
- Run the
goalAdded()
function manually or ensure that the manual trigger is set up to initialize goal tracking. - The script will automatically manage triggers for daily checks and updates based on the goal start and due dates.
- Use
manualCheck()
for manual goal checks. - View deal data associated with goals in the "Deals" sheet.
- Ensure that the HubSpot API key is valid and has appropriate permissions.
- Customize the project to fit your specific goal tracking needs.
- Review and test thoroughly before deploying in a production environment.