This guide explains how to capture data changes in your Google Sheet and automatically send them to Ours Privacy using Google Apps Script. This is especially useful if you need to track conversions or other key events from your internal data and push them to your ad and analytics platforms.
For more details on the API, check out the Ours Privacy API documentation here.
In this example, you'll learn how to create an "On Edit" trigger. The trigger monitors a specific sheet and column in your Google Sheet. When a change occurs, it extracts the row's data and sends an event (such as a conversion) to the Ours Privacy API. This process automates your data flows and ensures that key events are accurately captured and forwarded.
A sample Google Sheet is available for reference here, and you can watch a brief demo video below.
Sample file: https://docs.google.com/spreadsheets/d/1Uo4je04947P3-LPSbkyqKBHRn6Q71fOARdSJ1ya-AqY/edit?usp=sharing
Accessing the Apps Script editor lets you create custom logic that listens for changes in your data.
This script monitors a specific sheet and column. When an edit occurs, it gathers the relevant row data and sends a POST request to the Ours Privacy API. Replacing 'YOUR TOKEN HERE'
with your actual token ensures the event is authenticated and connected to your Ours Privacy account.
targetSheet
: The name of the sheet you want to monitor.targetColumn
: The column number that, when edited, triggers the event.The installable trigger ensures that your script automatically runs whenever someone edits the designated column. Granting OAuth permissions lets your script securely communicate with the Ours Privacy API.