RTB House Conversions API tag
RTB House Conversions API by Stape is a custom Google Tag Manager (GTM) server-side template designed to send page view, product, basket, and conversion events from your server container directly to the RTB House Conversions API (CAPI) in the Americas, EMEA, and Asia regions.
With the RTB House Conversions API tag you can:
- Use a broad range of events – the tag supports 17 event types, covering page views, product, wishlist, search, basket, order funnel, conversion and consent withdrawal. Custom events are available for names agreed with your RTB House representative.
- Automatically map data – automap fills the timestamp, page URL, referrer, product IDs, and order/conversion value and ID from Event Data.
- Identify users – the tag can read or set the
__rtbh.aidcookie, generating a new ID if none exists. - Send multiple products in a basket with one request – sends one request per product ID when
Basket Addedincludes multiple products. - Control consent – the tag supports a built-in
ad_storageconsent check to respect user consent before firing.
Before you begin
To complete this setup, you will need to create a sGTM container and send data from the web to the sGTM container. You will also need an active RTB House account and obtain Tagging Hash and Partner Key. Contact your RTB House account manager to obtain those.
How to set up RTB House Conversions API tag
- 1.
- 2.Go to Google Tag Manager and open your server container.
- 3.Go to Templates, and under Tag Templates, click New.

4. At the top-right, click three dots → Import.

5. From the unzipped folder, select the template.tpl file.
6. Click Save.

7. Go to Tags and click New.

8. Click Tag Configuration and select the RTB House Conversions API by Stape tag.

9. Select Event Type Setup Method:
- Standard – choose an event such as
Product Page Viewed,Basket AddedorOrder Confirmed. - Custom – enter your own Event Name and Event Value, agreed with your RTB House representative. The tag sends the event that looks like this:
custom_{eventName}_{eventValue}.For example, you can sendcustom_newsletter_signup, where the event name isnewsletterand value issignup.
10. Enter Tagging Hash.
11. Enter Partner Key (PKey).
12. Select Region. If you're not certain which region to use, contact your RTB House representative.

13. Select Identifier Type. Set which kind of user ID the tag sends to RTB House to track the user.
- Anonymous ID – a pseudonymous identifier used to track or sync unauthenticated visitors across events and advertising endpoints without exposing PII. In this case select whether you want to store the Anonymous ID as the
__rtbh.aidcookie by checking Set Anonymous ID "__rtbh.aid" cookie. If unchecked, an existing Anonymous ID is still sent if found, but it isn't stored as a cookie and isn't auto-generated. When enabled, set Anonymous ID Cookie Settings:- Cookie Domain – specify which domain (and subdomains) are allowed to access and read the cookie stored in the user's browser. If you specify a domain manually (such as
shop.example.com), only that exact subdomain can read the cookie; other subdomains onexample.comwon’t have access to it. Leaving it asautois the standard setup to automatically set the cookie on the highest possible parent domain. For example, if a user visitsshop.example.com, auto writes the cookie to.example.com. This ensures the cookie is shared across all subdomains (likeblog.example.comorcheckout.example.com). - Cookie SameSite – define whether a cookie is sent with cross-site requests. For more information read the Mozilla documentation.
- Cookie HTTP flag only – controls whether page JavaScript can read the RTB House cookies. If
True, JavaScript can’t read it. Keep itFalseif your own scripts need to read the cookie. - Cookie Expiration – determine how long (in days) the browser keeps the
adfuidcookie stored before automatically deleting it. - User ID – uses a hashed email or phone number for cross-device tracking. The tag looks for the User ID in the
__rtbh.uidcookie, then thertbh.uidEvent Data key. The tag doesn’t create the cookie. - Session ID – a cookie that stores a unique 24-hour identifier for each user session. The tag reads the
__rtbh.sidcookie, then thertbh.sidEvent Data key.
14. Enable Automap User Identifiers Parameters for the tag to automatically map parameters from the Event Data based on the selected Identifier Type.
15. Enter Identifier Value if you want to send a specific ID instead of the one automap would find. Automap reads only the __rtbh.{type} cookies and the rtbh.{type} / __rtbh.{type} Event Data keys. If your site stores the ID under another name, enter it here (for example, mapped from a variable).
16. If you set Use Optimistic Scenario to true, the tag will call gtmOnSuccess() without waiting for a response from the API. This will speed up sGTM response time however your tag will always return the status fired successfully even if it isn’t.

17. Under Server Event Data Parameters, the Automap Server Event Data Parameters is set to true by default, and in this case the tag sets the timestamp to the time it fired, as well as page URL. You can additionally add server event data parameters, if automap doesn't give the right value. For example, if the page URL is stored under another Event Data key.

18. Under Event Parameters, you can set data for events from the Standard event setup method. Usually, those events are taken from automap, but there might be cases when your product IDs, value or order ID sit under other names, or the page doesn't send them. In this case you can manually supply values.

19. In Tag Execution Consent Settings you can control whether a tag fires and sends HTTP request data based on the user's consent status:
- Send data always – the tag fires and sends data to the API on every trigger, regardless of whether consent was granted or denied.
- Send data in case marketing consent given – the tag safely aborts firing if
ad_storageconsent (Google Consent Mode or Stape's Data Tag parameter) isn’t granted.

20. In Advanced Settings you can add additional metadata. For more information see the Google documentation.
21. Select a trigger that fits the data you send. For example, Home Page Viewed, Category Page Viewed and Product Page Viewed need a trigger that fires on those page views, Order Confirmed needs a trigger that fires on the purchase event.
22. Click Save.

Testing
In GTM, open the Preview mode and do some actions on your site to trigger the events. Confirm that the tag is firing.

Was this article helpful?
🍽 Table of content:
Comments