Stape Store Lookup Variable for Google Tag Manager Server Container

The Stape Store Lookup Variable for Google Tag Manager Server-Side allows you to retrieve data from Stape Store. You can look up a specific document by its ID or query a collection to find a document that matches certain criteria.

This is useful for retrieving user data, product information, or any other data you’ve previously stored.

How to use

  1. Add the Stape Store Lookup Variable to your server container from the GTM Template Gallery.
  2. Select a Lookup Type:
    • Document ID: Provide the unique key of the document you want to retrieve.
    • Query: Specify conditions to search for a document. The first match is returned.
  3. (Optional) Provide a Property To Return (e.g., user.address.city) to retrieve a specific nested value from the document. If left empty, the entire document data is returned.
  4. (Optional) Enable Store the result in cache to improve performance by caching the response.
  5. (Optional) Specify a Stape Store Collection Name. Defaults to default.
  6. Use the variable in your tags, triggers, or other variables.

Useful Resources

Open Source

The Stape Store Lookup Variable for Google Tag Manager Server Container is developed and maintained by Stape Team under the Apache 2.0 license.

GTM Gallery Status

:green_circle: Listed

GitHub

:green_circle: Repository

stape-io/stape-store-lookup-variable — updated: view commit

  • Removed all logging functionality including Logs Settings and BigQuery Logs Settings
  • Deleted all related logging code and dependencies from the template
  • Removed logging configuration parameters and permissions from the template data
  • Simplified data encoding function to handle null or undefined inputs only

GTM Gallery Status

:green_circle: Listed

stape-io/stape-store-lookup-variable — updated: view commit

  • Added “Add condition” button for Query conditions UI
  • Renamed “Key Path” to “Property To Return” and updated help text with option to return the whole document
  • Introduced cache expiration time setting for cached responses in Template Storage
  • Improved response caching logic to check expiration and store cached items with expiry metadata
  • Refactored request URL, options, and query body generation functions for better clarity and error handling

GTM Gallery Status

:green_circle: Listed

stape-io/stape-store-lookup-variable — updated: view commit

  • Simplified promise chain by passing mapResponse directly to then() without conditional return

GTM Gallery Status

:green_circle: Listed