Stape Store feature
Updated Mar 28, 2025
Stape Store is a built-in NoSQL database designed to work seamlessly with Stape’s server-side Google Tag Manager (sGTM) container. It provides a straightforward way to store, retrieve, and sync data in your sGTM container (e.g., authorization keys, user attributes, or custom parameters) without needing external platforms like Firestore or Supabase. This integration helps eliminate complex authentication flows and reduces the risk of tracking misconfigurations.
The functionality and design of the Stape Store are extremely similar to Firebase. You can store JSONs of data organized in documents of up to 1MB using intuitive tags and variable templates.
We have developed three custom templates to work with Stape Store:
- Stape Store Writer tag to write data to the Stape Store.
- Stape Store Lookup variable for reading data from in database.
- Stape Store reStore variable to retrieve and/or immediately record data within Stape Store.
The Stape Store feature is available for server-side GTM Pro subscriptions and higher.
Benefits of Stape Store
- Cost-effective - Stape Store is included at no extra charge for Pro and higher plans. Marketers and analysts can leverage a powerful data store without incurring additional subscription or hosting fees.
- Simple setup - no extra services or complex OAuth credentials needed. Stape Store is ready to use out of the box for Pro plan users and above.
- Unified data management - keep critical data (such as API tokens and product details) under one roof without toggling between multiple tools or databases. This streamlines data handling in your sGTM workflows, creates fewer error points, and provides a local, near-instant data read/write system (similar to Firestore’s speed).
How to use Stape Store
1. Log in to your stape.io account.
2. Select your sGTM container on the dashboard.

3. Open the Store tab.

4. As you can see, the Stape Store dashboard is currently empty.

Stape Store dashboard
The Stape Store dashboard showcases all the documents you’ve uploaded. You can click on a document to view its data. You can also search by document name or key and value. Finally, you can click Upload CSV to upload a document or click Add document to create a document manually / click Add field to create a field manually.

Stape Store templates
To interact with Stape Store (e.g., write data to it), we will use one of Stape’s proprietary tags.
How to use the Stape Store Writer tag
1. Go to https://tagmanager.google.com/
2. Install the the Stape Store Writer template:
- Click on the Templates menu.
- Click Search Gallery in the Tag Templates section.
- Find Stape Store Writer and click Add to workspace.

3. Configure the Stape Store Writer tag:
- Click on the Tags menu → click New.
- Click on the Tag Configuration panel → select Stape Store Writer.
- Enter the tag’s configurations:
- Make sure to enter a Document Key - it will be used as the document’s name in Stape Store dashboard. For instance, this could be done with Stape’s User ID power-up (see the User ID guide), just use {{X-Stape-User-Id}} as a Document Key. Or you could use any other document identifier.
- Finish setting up the tag by giving it a descriptive name and choosing a trigger → click Save.

Testing the Stape Store Writer tag
And just like that, you’ve configured the Stape Store Writer tag. Once the chosen trigger occurs, you will see the Writer’s data on the Stape Store dashboard.

Stape Store Lookup variable
1. Go to https://tagmanager.google.com/
2. Install the the Stape Store Lookup template:
- Click on the Templates menu.
- Click Search Gallery in the Variable Templates section.
- Find Stape Store Lookup and click Add to workspace.

3. Configure the Stape Store Lookup variable:
- Click on the Variables menu → click New.
- Click on the Variable Configuration panel → select Stape Store Lookup.
- Enter the variable’s configurations:
- In Document ID, use a document identifier, for instance {{X-Stape-User-Id}} if you use User ID (only available once you’ve configured Stape’s User ID power-up, please see the User ID guide).
- Under More Settings → Key Path, enter the path to the data you wish to read, for example, user_data.email.
- Finish setting up the variable and give it a descriptive name → click Save.

4. The next step is to add this variable to an event:
- Click on the Tags menu → select an event you’d like to add the variable to.
- Configure the event to match the type of data you’re looking for with the variable you've created.
- Click Save.

Testing the Stape Store Lookup variable
You’ve configured the Stape Store Lookup variable. Once the chosen event occurs, you will see that the data was successfully sent on the GTM preview screen.

Stape Store reStore variable
1. Go to https://tagmanager.google.com/
2. Install the the Stape Store reStore template:
- Click on the Templates menu.
- Click Search Gallery in the Variable Templates section.
- Find Stape Store reStore and click Add to workspace.

3. Configure the Stape Store reStore variable:
- Click on the Variables menu → click New.
- Click on the Variable Configuration panel → select Stape Store reStore.
- Enter the variable’s configurations:
- Under List of identifiers, click Add Row → enter the identifier by which the reStore variable should identify the user, e.g., Name = user_id, Value = {{X-Stape-User-Id}} (only available once you’ve configured Stape’s User ID power-up, please see the User ID guide). You can add multiple identifiers so that the variable will match the user even if some of the identifiers fail.
- Under List of data that needs to be restored, click Add Row → enter the data you want to be restored from the identified user, e.g., Name = phone, Value = {{ed - phone number}}.
- Finish setting up the variable and give it a descriptive name → click Save.

Testing the Stape Store reStore variable
Congratulations, you’ve configured Stape Store reStore! Once the chosen event occurs, you will see the restored data on the Stape Store dashboard.

Stape Store API
Would you like to set up your interactions with Stape Store directly via API instead of utilizing Stape’s interface and/or tags? Here is the general API documentation for using the Stape Store API through which your developers can integrate it.
Base URL
The base URL for all API requests is:
https://{CONTAINER_DOMAIN}/stape-api/{CONTAINER_KEY}/v1/store
Both CONTAINER_DOMAIN and CONTAINER_KEY could be retrieved from the request headers. See example below:
function getBaseUrl() {
const containerIdentifier = getRequestHeader('x-gtm-identifier');
const defaultDomain = getRequestHeader('x-gtm-default-domain');
const containerApiKey = getRequestHeader('x-gtm-api-key');
return (
'https://' +
enc(containerIdentifier) +
'.' +
enc(defaultDomain) +
'/stape-api/' +
enc(containerApiKey) +
'/v1/store'
);
}
Endpoints
Add / update documents
This endpoint is used to create or overwrite a single document.
If the document does not exist, it will be created. If the document does exist, its contents will be overwritten with the newly provided data. If you want to merge data into an existing document instead of overwriting it, use the PATCH method instead of PUT.
Endpoint
PUT /v1/store/{key}
PATCH /v1/store/{key}
Request
Content-Type: application/json
Parameter | Type | Description |
key | string | The identifier for the document. Should match the regex ^[a-zA-Z0-9_$%@+=.\/\-]+$ |
The request body should contain JSON-structured data to add or update the document.
{
"key-string": "value",
"key-array": [
"item1",
"item2"
],
"key-object": {
"key1": "1",
"key2": 2
}
}
Example
PUT /v1/store/uniquekey
Content-Type: application/json
{
"name": "John Doe",
"age": 30,
"identifiers": [
123456,
"john@doe.com"
]
}
Get documents
This endpoint is used to retrieve data for the document identified by the key parameter.
GET /v1/store/{key}
Parameter | Type | Description |
key | string | The identifier for the document. Should match the regex ^[a-zA-Z0-9_$%@+=.\/\-]+$ |
Example
GET /v1/store/uniquekey
Delete documents
This endpoint is used to delete the document identified by the key parameter.
DELETE /v1/store/{key}
Parameter | Type | Description |
key | string | The identifier for the document. Should match the regex ^[a-zA-Z0-9_$%@+=.\/\-]+$ |
Example
DELETE /v1/store/uniquekey
List documents
This endpoint lists and filters documents based on the specified criteria.
POST /v1/store
Request Headers:
Content-Type: application/json
Body parameters
Parameter | Type | Description |
key | string | Optional. Filter by document key. Should match the regex ^[a-zA-Z0-9_$%@+=.\/\-]+$ |
data | array[] | Optional. Filter by document data using a three-item array containing: 1. Name of the document data filed. 2. One of the supported query operators. 3. Value used for quering. |
limit | integer | Optional. Limit the number of documents per page. Default is 10. |
skip | integer | Optional. Skip a certain number of documents (pagination). |
Query operators
- equal - Equal. Checks if the specified field is equal to the provided value.
- not-equal - Not Equal. Checks if the specified field is not equal to the provided value.
- lt - Less Than. Checks if the specified field is less than the provided value.
- lte - Less Than or Equal. Checks if the specified field is less than or equal to the provided value.
- gt - Greater Than. Checks if the specified field is greater than the provided value.
- gte - Greater Than or Equal. Checks if the specified field is greater than or equal to the provided value.
- array-contains - Array Contains. Checks if the specified field, treated as an array, contains the provided value.
- array-contains-any - Array Contains Any. Checks if the specified field, treated as an array, contains any of the provided values.
- in - In. Checks if the specified field value is in the list of provided values.
- not-in - Not In. Checks if the specified field value is not in the list of provided values.
- contains - Contains. Checks if the specified field value contains the provided value (string search).
- not-contains - Not Contains. Checks if the specified field value does not contain the provided value (string search).
Example
POST /v1/store
Content-Type: application/json
{
"data" : [
[
"age",
"gt",
25
],
[
"identifiers",
"array-contains-any",
["john@doe.com", "john+1@doe.com"]
]
],
"limit" : 1
}