New customer tracking with sGTM and Stape Store: a complete guide

Written by

Luc Nugteren

Published Mar 4, 2026 comments

Key takeaways

Why new accurate customer tracking matters

System overview: what we’re building

1. A first-party customer database stored inside Stape Store

2. A deterministic classification logic based on purchase_count

3. An advanced extension for first-click attribution

High-level architecture

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

Step-by-step configuration

1. Activate Stape Store in your server container

Enable the Stape Store inside the Stape container.

2. Hash and upload all past customer emails

  1. 1.
  2. 2.
  3. 3.
  4. 4.
email: <hashed_email> purchase_count: 1

3. Hash incoming emails in sGTM and write to Stape Store

  1. 1.
  2. 2.
  3. 3.
  4. 4.
email: <hashed_email> purchase_count: {{purchase_count}}
Stape Store Writer tag configuration.

4. Look up the hashed email in the Stape Store

5. Create new vs. returning logic in sGTM

  1. 1.
  2. 2.
  3. 3.
Conditional logic in the Lookup table showing purchase_count evaluation.

6. Use these values in Google Ads and meta tags

Advanced extension: first-click new customer tracking

How it works

1. Count sessions in sGTM

2. Capture click IDs when they appear

3. Store these values under a per-user key

4. On purchase, check the flags

Why this matters

Validation and maintenance

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