Profit tracking with sGTM and Data Store: a complete guide

Written by

Luc Nugteren

Published Mar 30, 2026 comments

Why profit tracking matters

System overview: what we're building

1. A product margin database stored inside Data Store

2. A real-time margin calculation triggered on each purchase

3. Profit-specific conversion tags for each platform

High-level architecture

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.

Step-by-step configuration

1. Activate Data Store in your tagging server

Activate Data Store inside the Stape UI.

2. Add product margin data to Data Store

Option B: manual CSV upload

Product margin data stored inside Data Store. Each document contains the product identifier and margin value

3. Install the margin Lookup Variable in sGTM

  1. 1.
  2. 2.
  3. 3.
  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
The Margin Lookup variable configuration. It reads the GA4 items array, matches each item against the Store, and returns total profit

4. Create profit tags for Google Ads

  1. 1.
  2. 2.
  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
The Google Ads profit tag. Note the Conversion Value field using the Data Store Margin Lookup variable, and the profit-specific Conversion Label

5. Create profit tracking for Meta

Option A: separate custom event via Conversions API

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.

Option B: Meta's profit-based campaign optimization (beta)

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.

6. Add profit data to GA4

  1. 1.
  2. 2.
  3. 3.
  4. 4.

Advanced extension: combining profit with new customer tracking

Why this matters

How to implement

  1. 1.
  2. 2.
  3. 3.

Validation and testing

Conclusion

Want to try the server side?

Try for free

Written by

Luc Nugteren

Content writer

Luc is a tracking specialist focused on server-side tagging and data accuracy, helping ecommerce brands and agencies build scalable measurement systems that improve attribution and performance.

Was this article helpful?

Comments

Recommended for you

Turn better tracking into better marketing performance

Try for free