Table of contents

How to set up Profit Tracking with Google Tag Manager and Firestore

profit-tracking

Advertisers are constantly looking for ways to measure and improve the effectiveness of their campaigns. With the emergence of Profit Tracking, marketers have a new weapon in their arsenal. This insightful measurement tool extends beyond the traditional ROAS (Return On Ad Spend) by looking not only at revenue, but also at the profit generated by each dollar invested. This blog takes you on a journey through the world of Profit Tracking, from the basics to advanced implementation with Google Tag Manager (GTM) and Firestore.

Key points 🔑

  • Profit Tracking is an advanced metric that measures both revenue and profit generated from ad spend, for a more complete picture of its contribution to company profit.
  • Unlike ROAS, which focuses on revenue, Profit Tracking takes profitability into account by including costs such as COGS and operating expenses.
  • By implementing and testing Profit Tracking, advertisers can better align their advertising strategies with profitability rather than just revenue, which can lead to more financially sustainable ad campaigns.

What is Profit Tracking?

Profit Tracking is an advanced metric that goes beyond ROAS by measuring not only revenue generated from ad spend, but also profit. It provides a clearer picture of the actual contribution of ad spending to operating profit and enables advertisers to make more informed decisions about their advertising strategy.

Replacement for Purchase Event

Profit Tracking is a replacement for the purchase value you normally send along in Google Tag Manager. Instead of revenue, which is what you use for ROAS, you now send profit.

Profit Tracking Calculation = (Conversion Value - Purchase & Sales Costs) / Cost.

Profit Tracking Example

Background: An e-commerce company specializing in durable outdoor apparel is looking to optimize their ad spend to increase profitability.

Challenge: The company is having success with their current ad campaigns on various digital platforms, but is struggling to accurately measure the actual profit generated by each ad dollar. The current focus is on revenue, with no direct link to net profit after costs and expenses.

Solution: By implementing Profit Tracking, businesses can gain a deeper understanding of the actual profitability of their advertising efforts. They do this by including not only revenue but also cost of goods (COGS), operational costs, and platform-specific advertising costs in their calculations.

Profit Tracking vs ROAS

But it's all about ROAS, right?

ROAS (Return On Ad Spend) has long been the standard KPI (Key Performance Indicator) for many advertisers. However, the emphasis on gross revenue without considering actual profitability can be misleading. It often leads to a distorted view of the effectiveness of ad spending because it does not take into account costs outside of direct ad costs, such as product costs, overhead, and other operational expenses.

ROAS vs Profit Tracking: who wins?

Profit Tracking is a better metric because it helps advertisers focus on profitability and not just revenue. It encourages deeper analysis of cost structure and pricing strategies, allowing for better management of the net results of ad campaigns. This makes Profit on ad spend a more holistic approach to measuring the effectiveness of ad spend.

ROAS vs Profit Tracking Comparison Chart

While ROAS and Profit Tracking offer valuable insights, they focus on different aspects of financial returns. Below is a detailed comparison table that highlights the key features of each of these metrics.

Aspect ROAS Profit Tracking
Definition Return on Advertising Spend Profit Tracking
Focus Revenue generated per euro spent on ads Profit generated per euro spent on ads
Calculation Revenue from advertisement / Cost of advertisement x 100% Gross profit margin / costs
Example €4000 revenue / €1000 expenses = 4:1 ROAS €250 profit / €200 expenses = 1.25 Profit Tracking
Limitations Does not take into account company size, reselling or product differentiation More complex in calculation, requires understanding of profit margins

Profit Tracking set up using GTM and Firestore

In this tutorial, we will show you how to achieve a detailed tracking setup with Google Tag Manager and Firestore. Thanks to the integration with the Google Service Account, you can use this for free.

What you must have set up beforehand:

  • 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.

There are no additional costs associated with Profit Tracking when you set it up yourself. When you want to use our specialists, only the setup costs are applicable once!

1. Create a new project (Google Cloud)

Log in to Google Cloud Console, go to your dashboard and create a new project.

create-new-project-google-cloud

Give the project a name, for example, Profit Tracking TAGGRS, and then click Create.

create-new-project-google-cloud-add-name-and-organization-location

2. Create Firestore (Google Cloud)

Then click View all products at the bottom left and scroll down until you get to Firestore. Then click here.

select-view-all-products-google-cloud-platform
select-fire-store-google-cloud-platform

3. Database creation Firestore (Google Cloud)

We are now going to create a database. Click Create Database. Next, select Native Mode. Then select the nearest location and click Create Database.

create-database-firestore-google-cloud
select-native-mode-firestore-database-google-cloud

4. Collection creation Firestore (Google Cloud)

Next, we are going to create a collection by clicking on START COLLECTION.

start-collection-firestore-google-cloud

5. Collection setup Firestore (Google Cloud)

Next, enter the Collection ID. Since we are talking about products we choose products. Next we need to 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. Then click Save to save the collection.

setup-collection-firestore-profit-tracking-google-cloud

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

set-up-profit-tracking-in-firestore-google-cloud-products-collection-id-and-profit

6. Cloud Console Private Key creation (Google Cloud).

Once Firestore is set up, we need to start linking this along with TAGGRS so that the data is associated with the relevant platform. Within your project, go to IAM & Admin.

go-to-iam-and-admin-google-cloud-console

Next, go to Service Accounts and click Create service account. Then enter your required information here. The Service account name is required, the following steps are optional.

create-service-account-iam-and-admin-google-cloud-console

Then click on your created service account. And at the top of the menu, choose KEYS. Next, click on ADD KEY.

add-key-google-cloud-console

We are going to create the Key next. Choose JSON, and click CREATE. A file will then be downloaded.

create-private-key-profit-tracking-with-taggrs-1

7. Add Cloud Console Private Key to dashboard (TAGGRS).

Within your TAGGRS Dashboard, go to 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.

connect-google-service-account-in-taggrs-dashboard

8. Insert template in Google Tag Manager (Server Container).

The work in Firestore and TAGGRS is done, we now go to the Google Tag Manager Server Container. Go to Templates and then click New under Variable Templates.

create-new-variable-template-google-tag-manager-server-container

Then click on the 3 dots at the top right and click Import. We're going to import a template from Github here. Within the Github Template, click on the 3 dots and then click Download.

download-github-template Tracking-tracking-profit

9. Set up template in Google Tag Manager (Server Container).

Once you have downloaded the template, we need to check one more thing. The Path at Permission in template must be same the Collection ID within Firebase (step 7). We are using Products in this case. Check if this is the same.

template-editor-firestore-item-value

10. Create new Variable for Profit Tracking (Server Container).

We now need to create a new variable for Profit Tracking in Google Tag Manager. Within the Server Container, go to the Variables section and click New. This starts the process of defining a name that represents specific data for profit data, which you can then use in your tags and triggers. Give the tag a name, for example Profit tracking - firestore.

create-new-variable-server-container-gtm

11. Variable Configuration (Server Container).

Click on Variable Configuration. As Variable Type, choose Item Value from Firestore (Custom Template you just added).

profit-tracking-firestore-item-value-custom-template-gtm-server-container

12. GCP Project ID Add Variable (Server Container).

Next, you need to add the GCP Project ID. You can find this within Firestore. Click on your account name at the top next to the search bar and then you will see the project ID.

project-id-profit-tracking-firestore-google-cloud

13. Profit Tracking variable setup (Server Container).

Next, at Value Field, add the same thing you pass in Firestore as Field Name. In our example, we use Value. At Firestore Collection ID, add Collection ID that you also used in step 7. In our case, this was Products. Then save the variable.

set-up-variable-profit-tracking-fire-store-done-server-container

14. Select Google Ads Conversion Tracking Tag (Server Container).

We are next going to add this Profit Tracking Variable to the Google Ads Conversion Tracking Tag and the GA4 Configuration Tag. We'll start with the first of the two. Go to the Google Ads Conversion Tracking Tag. Note that this does involve the Conversion Tracking Tag in the Server Container! Don't have this one set up yet? Then check out this blog.

select-google-ads-conversion-tracking-tag-google-tag-manager-server-container

15. Customize Google Ads Conversion Tracking Tag (Server Container).

We need to change the Conversion Value in the Conversion Tag. As Conversion Value, add the variable you just created. Then save the tag.

add-profit-tracking-variable-to-google-ads-purchase-event-conversion-tag-server-container

16. GA4 Configuration Tag Setup (Server Container).

We are also going to add this variable to the GA4 Configuration Tag. Go to the Configuration Tag and under Event Parameters --> Parameters to Add / Edit add the following:

  • Name: value
  • Value: {{Profit tracking - firestore }}
add-profit-tracking-variable-to-configuration-tag-server-container

Next, save the tag. Then put the container Live and you have profit on ad spend set up in Google Tag Manager!

Profit Tracking Testing with Google Tag Manager

Next, we are going to test whether the Profit Tracking settings are working. We will do this by using the preview mode, both in the Web Container and in the Server Container. We are going to make a test purchase and then check the variables to see if the profit is sent along.

Add custom profit tracking columns in Google Ads

Next, we need to add custom columns to the Google Ads interface to optimize your campaigns for profitability.

Create new columns: Start by opening your Google Ads account. Go to the "Campaigns" tab, select "Columns" followed by "Customize Columns. Here you can add new columns.

Use the following math operators to create the column conditions:

  • Profit Tracking = Conversion Value (filter by Conversion Source, select new conversion action) / Advertising Cost
  • Net Margin = Conversion Value (filter by Conversion Source, select new conversion action) - Advertising Cost

Application and Analysis: After saving the settings, return to "Customize Columns" where you select and apply the new columns. This step allows you to monitor your campaign performance with the newly created financial metrics.

Conclusion

With the implementation steps from the blog, you are now equipped with the knowledge to effectively configure Profit Tracking through Google Tag Manager and Firestore. This setup strengthens your ability to understand the true profit of your ad spend. By applying this methodology, you take a big step forward in optimizing your ad budget and achieving a higher return on your ad investments.

FAQ

Do you need Server Side Tracking to get started with Profit Tracking?

Without a server, you cannot connect to Firestore, which is why you need Server Side Tracking to use Profit Tracking.

About the author

Recently published

magnifiercrossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram