Stape
Search
Contact salesTry for free

Meta CAPI for Salla via server GTM

Uliana Lesiv

Uliana Lesiv

Author
Published
Aug 29, 2025

Step 1. Set up server Google Tag Manager container

Click on Admin section → then click +

Create container
Create container

1.2. Add the container name, choose Server as a target platform, and click Create.

Create server GTM container
Create server GTM container

1.3. Select Manually provision tagging server, copy the container config, and paste it into any text editor. We will need it for the next steps.

Install GTM
Install GTM
Log in to Stape account
Log in to Stape account

1.5. In the Stape's admin, click Create container on the right. 

Create sGTM container
Create sGTM container

1.6. Add container details:

  • Container name - you can choose any name; it shouldn't necessarily be the same as in your server GTM.
  • Container configuration - paste the Container Config that you copied while creating the server GTM container.
  • Server location - select your server location based on the location of most of your clients. Please note that the location can not be changed later.

Click Create Container.

New container configurations
New container configurations

1.7. Choose a plan for your container. You can try a Free plan. 

Stape subscription plans
Stape subscription plans

1.8. Check the status of your container, its configuration, and your plan name in the Stape admin.

Deploying a server container typically takes about 5 minutes. To view the updated status, refresh the page. If the Google Tag Manager server-side setup was completed successfully, the status should show as Running.

Configured container on Stape
Configured container on Stape

Step 2. Set up Stape's power-up Custom Loader

What's Custom Loader? The Custom Loader is a Stape's power-up, which modifies gtag.js and gtm.js loading paths, allowing you to minimize ad blockers on data collection. Using the Custom Loader may increase data volume up to 40%.

2.1. Find and copy your web GTM container ID

Log in to your Google Tag Manager account and open your web GTM container. In the top right corner of the screen (next to the Submit and Preview buttons), you'll find a short identifier beginning with "GTM-" followed by a combination of letters and numbers. This is your Web GTM ID. 

Copy it to use later.

Web GTM container ID
Web GTM container ID

2.2. Open the sGTM container on Stape → Click on the Power-Ups section.

Find Custom Loader and click Configure.

Power-ups section in Stape
Power-ups section in Stape

2.3. Configure the following settings:

  • Domain - choose from the list the domain that will load gtm.js and gtag.js.
  • Web GTM ID - enter your web Google Tag Manager ID. If you're unsure where to find it, refer to our guide on web GTM ID.
  • GA4 ad block bypass - it is optional. If you turn it on, it enables a workaround to reduce the impact of ad blockers on GA4 tracking. Keep in mind that this applies to all domains in the container. After enabling, make sure to debug both your web and server GTM containers.
  • Same Origin Path - if you're using the same-origin method for your custom domain setup, provide the proxy path for the requests.
  • Platform - the Custom Loader script is platform-specific. Select Salla.
  • User identifier type - select the method to identify the user, you can choose from cookie, local storage, DOM element, JavaScript variable, or Stape User ID. Learn more about the user identifier type in our documentation.

Click Generate, and follow the instructions provided on the right.

Custom Loader configuration example
Custom Loader configuration example

Step 3. Configure the Salla app

3.1 Log in to your Salla account. To install the app, you need to buy the app on the Salla platform (you have a 7-day free trial).

Add Salla app
Add Salla app

3.2 Configure the app. You will need to configure three sections of a single-page app installation: General, Data Layer, and Webhooks.

3.2.1 General section.

This section contains all the options for configuring the GTM snippet installation on every page of your Salla site.

Add the following data:

  • Insert GTM snippet - check the box to add the GTM snippet to every page on your Salla website. 
  • Specify WEB container ID - add the GTM web container ID (you can find it in your GTM account in the tab Accounts). The format should be the following: GTM-XXXXXXX.
  • Add custom domain - use the subdomain you have created for server-side tracking. It should start with https:// without any extra slashes at the end, e.g., https://gtm.example.com
If you haven't configured a custom domain yet, please check Stape's guide on subdomain setup.
Container identifier in Stape
Container identifier in Stape
  • Cookie Keeper is Stape's power-up used to prolong cookie lifetime in Safari and other browsers with ITP. This option is available only if you use Stape.io's sGTM hosting and set up the Cookie Keeper power-up. Please also make sure to enable Stape User ID in your container power-ups. The User ID power-up creates a persistent, privacy-conscious user identifier and attaches it to each incoming request handled by your sGTM container.
General section configuration
General section configuration

3.2.2 Dala Layer section.

In this section, you can see toggles that enable Data Layer events. With their help, you can enrich the data by incorporating product and user details.

Data Layer section in Salla app
Data Layer section in Salla app

3.2.3 Webhooks section.

In this section, you can set up webhooks sending to a specified URL for various events, such as purchases and/or refunds.

To enable webhook configuration, check the box next to "Send webhooks to server GTM container." After that, provide the URL of your server container and /path where the webhooks should be sent in the format: https://gtm.example.com/data

Activate the appropriate fields based on the event type - purchase and/or refund.

If you would like to find out more about webhooks and configure them, please check our blog posts:

Click Save.

Webhooks section in Salla app
Webhooks section in Salla app

Step 4. Download pre-built templates from GitHub and import them into GTM

4.1 Download GTM templates from GitHub and unzip the file.

Download Salla templates from GitHub
Download Salla templates from GitHub

4.2. Import the templates into both your web and server containers in GTM

Please note: the .json files include not only Meta templates, but also templates for Google Analytics 4 and Google Ads.

GTM templates for Salla
GTM templates for Salla

The process of importing .json files is identical for both containers. Go to AdminImport Container to begin.

Import container in Web GTM container
Import container in Web GTM container

4.3. Choose your template file from the desktop, ensuring it matches the container type (web or server).

4.4. Select a workspace for the import; you may create a new one if needed.

4.5. Choose whether to Overwrite or Merge the existing configuration.

The Overwrite option should only be used with a new, empty container or if you're absolutely certain about replacing existing content. For this demo, we'll use the Merge option with Rename conflicting tags, triggers, and variables selected. This ensures that in case of any conflicts, GTM will simply rename the imported items, preserving your existing container setup.

Import Salla templates into GTM container
Import Salla templates into GTM container

Step 5. Сonfigure GTM container templates

5.1. The templates come fully configured, with triggers, payloads, and event names already set up for you.

All you need to do is enter your specific details (such as destination URLs, IDs, API keys, etc.).

To make things easier, both the Web and Server containers include a folder named [Stape] _Settings where these configurations can be managed.

In web GTM container:

Web GTM container folders
Web GTM container folders

In the server GTM container:

Server GTM container folders
Server GTM container folders

All of these variables are already linked to the relevant tags; you simply need to assign the appropriate values. For example:

Meta API token - GTM variable
Meta API token - GTM variable

5.2. Pixel ID and API token can be found in your pixel settings:

Dataset ID
Dataset ID
Generate access token
Generate access token

Step 6. Test the configuration

Meta allows you to test both browser and server events, which is helpful when setting up the Facebook Pixel with GTM server for the first time and wanting to make sure all data is tracked correctly.

6.1. To start, you'll need to get a test_event_code. To do this, log in to Facebook Business Manager, select the data source you want to test, and navigate to the Test Events tab. There, you'll find the test event code, something similar to TEST2120.

Test event code in Meta
Test event code in Meta

Please note: TEST ID is changing once in a couple of hours. If your debug sessions are spread in time, make sure to check that the value you're using is still valid.

6.2. In your server container, fill the LT - Map | Debug ModeFB Test ID variable with the test event code you obtained in the previous step.

LT - Map | Debug Mode → FB Test ID variable
LT - Map | Debug Mode → FB Test ID variable

This variable is already integrated into all Meta tags. It only activates in preview mode, so there's no need to remove it before publishing your setup.

6.3. Enable preview mode in both your web and server containers. If everything is set up correctly, you should see both web and server test events appear on the Facebook Test Events page.

Test your events
Test your events

Want to start on the server side?Register now!

author

Uliana Lesiv

Author

Uliana is a Content Manager at Stape, specializing in analytics and integration setups. She breaks down complex tracking concepts into clear insights, helping businesses optimize data collection.

Comments

Try Stape for all things server-sideright now!