{"id":22743424,"url":"https://github.com/stape-io/spreadsheet-variable","last_synced_at":"2026-01-08T00:40:51.667Z","repository":{"id":134834589,"uuid":"477324122","full_name":"stape-io/spreadsheet-variable","owner":"stape-io","description":"Google Sheets variable for Google Tag Manager Server Side","archived":false,"fork":false,"pushed_at":"2024-11-25T11:55:09.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T04:52:17.707Z","etag":null,"topics":["google","gtm","gtm-custom-template","gtm-server-side","spreadsheet","spreadsheets","stape"],"latest_commit_sha":null,"homepage":"https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager","language":"Smarty","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stape-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-03T11:43:12.000Z","updated_at":"2024-12-08T01:02:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcfa23ce-ede4-4942-af7f-52b8ae0ff04f","html_url":"https://github.com/stape-io/spreadsheet-variable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fspreadsheet-variable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fspreadsheet-variable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fspreadsheet-variable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fspreadsheet-variable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stape-io","download_url":"https://codeload.github.com/stape-io/spreadsheet-variable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277351,"owners_count":20751548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","gtm","gtm-custom-template","gtm-server-side","spreadsheet","spreadsheets","stape"],"created_at":"2024-12-11T01:22:49.321Z","updated_at":"2026-01-08T00:40:51.663Z","avatar_url":"https://github.com/stape-io.png","language":"Smarty","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Sheets Reader Variable for Google Tag Manager Server-Side\n\nThe **Google Sheets Reader Variable** for Google Tag Manager Server-Side allows you to read data from a Google Sheet and use it within your server container. This is useful for enriching data, creating lookup tables, or managing settings dynamically.\n\n**The variable supports three action types:**\n\n- **Read Cell**: Fetches the value from a single cell.\n- **Read Range**: Fetches all values from a specified range as a two-dimensional array.\n- **Read Two Columns**: Fetches data from two adjacent columns and returns it as a key-value object.\n\n### How to use the Google Sheets Reader Variable\n\n1.  Add the **Google Sheets Reader** variable to your server container in GTM.\n2.  Select the **Action Type**: `Read Cell`, `Read Range`, or `Read Two Columns`.\n3.  Provide the **Spreadsheet URL** of the Google Sheet you want to read from.\n4.  (Optional) Provide a **Sheet Name** (e.g., `Sheet1`). If not set, the first visible sheet is used.\n5.  Specify the **Cell** or **Range** using A1 notation (e.g. `A1`, `B2:C10`).\n6.  Choose your **Authentication** method.\n    - **Stape Google Connection** – Uses a simplified setup via Stape's connection. [Learn more](https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager#for-stape-users).\n    - **Own Google Credentials** – Uses Application Default Credentials from your GCP environment. [Learn more](https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager#for-non-stape-users).\n\n7.  Use the variable in your tags, triggers, or other variables within the server container.\n\n## Parameters\n\n### Main Configuration\n- **Type**: The read operation to perform.\n    - **Read Cell**: Returns the value of a single cell as a string.\n    - **Read Range**: Returns a range of cells as a 2D array (an array of rows, where each row is an array of cell values).\n    - **Read Two Columns**: Takes a two-column range and returns an object, using the first column for keys and the second for values.\n- **Spreadsheet URL**: The full URL of the target Google Spreadsheet.\n- **Sheet Name**: The name of the specific sheet (tab) to read from. This is optional if the sheet name is included in the Cell/Range parameter.\n- **Cell**: (For \"Read Cell\" type) The cell to read from, using A1 notation (e.g., `B4`).\n- **Range**: (For \"Read Range\" and \"Read Two Columns\" types) The range of cells to read, using A1 notation (e.g., `A1:D10`).\n\n### Authentication Credentials\n- **Auth Type**:\n    - **Stape Google Connection**: A simplified authentication method for Stape users. Requires enabling the **Google Sheets Connection** in your container settings.\n    - **Own Google Credentials**: Uses Application Default Credentials from a Google Cloud Platform environment. This requires enabling the Google Sheets API on GCP, setting up a service account and granting it access to your Google Sheet.\n\n## Useful resources\n\n- [How to read data from Google Sheets in server Google Tag Manager](https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager)\n- [How to set up the Stape Google Connection](https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager#for-stape-users)\n- [How to set up the Own Google Credentials](https://stape.io/blog/read-data-from-google-sheet-to-server-google-tag-manager#for-non-stape-users)\n\n## Open Source\n\nThe **Google Sheets Reader Variable for GTM Server-Side** is developed and maintained by the [Stape Team](https://stape.io/) under the Apache 2.0 license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstape-io%2Fspreadsheet-variable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstape-io%2Fspreadsheet-variable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstape-io%2Fspreadsheet-variable/lists"}