Profit Tracking

In this guide, you will learn you how to achieve a detailed tracking setup with Google Tag Manager and Firestore by setting up TAGGRS Profit Tracking. Thanks to the integration with the Google Service Account, you can use this for free.
Implementing Profit Tracking through TAGGRS enables you to move beyond standard Return on Ad Spend (ROAS) by measuring the actual profit generated by your campaigns. This approach delivers more actionable insights for optimizing ad budgets and achieving higher returns on spend.

Prerequisites

  • TAGGRS account
  • Data Layer
  • Web container GA4 set including Purchase Event
  • Set Server Container
  • Profit margins are not visible to visitors, as they are not visible in the data layer.

Create a Google Cloud Project and Firestore Database

1. In Google Cloud Console, create a new project.

To set up Profit Tracking start by creating a new project in Google Cloud Console

2. Give the project a name, e.g. Profit Tracking TAGGRS, and then click Create.

Give your project in Google Cloud To set up Profit Tracking start by creating a new project in Google Cloud a name nacho choose the location

Set up Firestore database

1. Click View all products at the bottom left, scroll down until you get to Firestore, select it.

Create Firestore in Google Cloud to set up TAGGRS Profit Tracking
Create Firestore in Google Cloud to set up TAGGRS Profit Tracking

2. Click Create database. Next, select Native mode. Then select the nearest location and click Create database.

Create a database in Firestore
Select native mode in Firestore

3. create a collection by clicking on START COLLECTION.

Start collection in Firestore

4. Enter the Collection ID. Since we are talking about products we choose Products.

5. Fill in the Document ID fill in the item ID of your product. In this case, we use 15123 as an example.
Then enter the following:

Field name: value
Field type: string
Field value: profit

As an example, we will use a profit of 10 per product, in which currency this is in depends on how you have set this up in Google Tag Manager. Then do this for all products.

Fill in the details of your Firestore collection in Google Cloud to set up TAGGRS Profit Tracking

6. Click Save to save the collection.

Then, you get a summary where you can see the collection, the item IDs of the products and the profit per product.

Summary of your Firestore collection

Create a Google Service Account and Private Key

Once Firestore is set up, you need to start linking this along with TAGGRS so that the data is associated with the relevant platform.

1. Within your Firestore project, go to IAM & Admin.

Go to your Firestore project in Google Cloud and select IAM & Admin

2. Go to Service Accounts and select Create service account. Then enter your required information here. The Service account name is required, the following steps are optional.

Fill the Service Account Name in your Google Cloud's Firestore project

Connect Firestore to TAGGRS

1. Click on your created service account. And at the top of the menu, select KEYS. Next, click on ADD KEY.

Add key to your project to link TAGGRS Profit Tracking to Firestore

2. Create the Key by choosing JSON, and then click CREATE. A file will then be downloaded.

3. Go to your TAGGRS Dashboard.

4. Select Integrations --> Google Service Account.
Next, upload your JSON file and click Connect.

Now, Google Cloud Firestore is connected to TAGGRS and you can immediately start importing and analyzing your Firestore data.

Import the Profit Tracking Template in GTM Server Container

1. In GTM Server, go to Templates → New under Variable Templates.
2. Import the Profit Tracking template from GitHub.
3. Ensure the path/permission in the template matches your Firestore collection ID.

Configure the Profit Tracking variable

1. In GTM Server, create a new variable using the imported template.
2. Set the GCP Project ID, Firestore Collection ID, and Value Field (e.g., "value").

Add the variable to your Conversion Tags

In your Google Ads Conversion Tracking Tag and GA4 Configuration Tag (Server Container), set the conversion value parameter to the Profit Tracking variable.

Test the setup

Use GTM Preview mode to simulate a purchase and verify that profit data is sent correctly.

Analyze Profit in Google Ads

In Google Ads, add custom columns to analyze profit and net margin using your new conversion actions.

FAQ

Do I need server-side tracking to get started with Profit Tracking tracking?‍

Yes, you can't connect to Firestore without a server, which means that you need server-side tracking to use Profit Tracking.

1. Create a collection (e.g. products).
2. For each product, add a document with the item ID and a field for profit value (e.g., value: profit).

1. In the TAGGRS dashboard, go to Integrations → Google Service Account.
2. Upload your JSON key and connect your Firestore project.