TrafficStars tag
Updated Aug 31, 2026
The TrafficStars tag by Stape allows you to track conversions and manage Click IDs from your server Google Tag Manager (sGTM) container using TrafficStars' server-to-server (S2S) postbacks. With this tag, you can store TrafficStars Click IDs during page views and send conversion postbacks to help maintain accurate attribution without relying solely on browser-based tracking.
- The tag automatically extracts Click IDs from landing page URLs and stores them in a first-party cookie for later use in conversion tracking.
- It supports conversion tracking with Goal IDs and API keys, as well as additional parameters such as conversion value, price, lead code, and duplicate conversions.
- An optional cookie syncing feature can use browser-side pixels to synchronize TrafficStars cookies when no valid Click ID is available, while the optimistic response mode can reduce tag execution latency.
Before you begin
Please ensure that you already have Google Tag Manager web and server containers, as well as a configured server container and custom domain in Stape. Please follow these guides if you don’t have any of those:
How to set up the TrafficStars tag
1. Configure sending data to the server GTM container. The most popular options for sending data to sGTM are Google Analytics 4 and Data Tag/Data Client. For more information, read the Send data to server container article.
2. Add the TrafficStars tag template in the server GTM container by importing it from the Template gallery:
- Search for the TrafficStars tag by Stape in the Google Tag Manager Tag Template gallery.
- Click Add to workspace.

3. Create the TrafficStars tag:
- Go to the Tags menu → click New.

- Click Tag Configuration → select TrafficStars.

4. Configure the TrafficStars tag:
- Event Type - select whether you wish the tag to pass Page View or Conversion events.
If you send Page View events
- When a user reaches the landing page, this tag will fire to store the Click ID from your ad destination URL (see below) in the _trafficstars_cid first-party cookie.
- Click ID URL Parameter Name - the query parameter key for your {click_id} token, found in your ad destination URL. It is user-defined in the TrafficStars platform at Ad Level (within a campaign) when building the ad URL. For example, if your ad URL is http://www.yoursite.com/?starstracker={click_id}, then starstracker is the Click ID you should enter in this input.
- Cookie Settings (Web only) - you can change parameters or just leave them as is to keep the default settings:
- Time the Cookie Expiration - use this to set cookie lifetime in days.
- Override the Cookie Domain - enter your website's top-level domain as a fixed value (e.g., example.com), or leave auto for the domain to be determined automatically.
- Set up the Cookie SameSite - control whether or not a cookie is sent with cross-site requests (requests originating from a site different from the one that set the cookie). Learn more about the cookie SameSite value.
- Cookie HTTP Only Flag - control whether the cookies can be accessed by JavaScript running in the browser.

If you send Conversion events
- This tag will fire to send a postback to TrafficStars.
- Click ID URL Parameter Name - the query parameter key for your {click_id} token, found in your ad destination URL. It is user-defined in the TrafficStars platform at Ad Level (within a campaign) when building the ad URL. For example, if your ad URL is http://www.yoursite.com/?starstracker={click_id}, then starstracker is the Click ID you should enter in this input.
- Goal ID - found in the Goals & Conversions - Postback tab of the TrafficStars admin panel by selecting a specific Goal.
- API Key - the key parameter in your Goals & Conversions - Postback URL. The API Key is the same for all Goals.
- Click ID Value - if left empty, this value will be automatically taken from the _trafficstars_cid cookie created by the Page View event, which is set on pages containing the {click_id} ad destination token in the Click ID Key URL parameter. If you do not wish to fall back to the default value, pass your own value to this field. Only modify it if you have a custom implementation. Learn more in the documentation on How to set up tracking conversions.

- Advanced Parameters - allow you to report additional parameters with the tag:
- Value: report your revenue with this parameter to track earnings and ROI.
- Price: report your cost for conversion with this parameter to track conversion cost.
- Lead Code: report multiple conversions for the same Click ID Value in this parameter to track post-conversion events.
- Allow Duplicates: allow conversion to be counted multiple times.
- Enable cookie syncing - sends 3rd party cookie-syncing pixels from the browser if the server-side conversion request fails due to unavailable or invalid Click ID. If enabled, provide your Profile ID, located in the TrafficStars admin panel Profile settings under the Personal Details section.
- Use Optimistic Scenario - the tag will call
gtmOnSuccess()without waiting for a response from the API.

- Tag Execution Consent Settings - choose if you wish for the tag to wait for marketing consent from the user before firing.
- Advanced Settings (Additional Tag Metadata) - specify additional tag metadata to be included in the event data when the tag is fired.

5. Add the Trigger for the tag, give it a descriptive name, and click Save.

Testing
You can test the configurations in Google Tag Manager. Click on Preview, trigger the event on your website with actions like viewing a page or completing a transaction, and check whether the tag has fired.

Find out more about debugging and monitoring server-side tracking configuration in our guide.
Was this article helpful?
Comments