Skip to content

ololabs/olo-serve-gtm-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olo Serve GTM Template

Table of Contents

Introduction

The easiest way to integrate Google Tag Manager (and Google Analytics) with Olo Serve is to use this template to automatically create custom GTM events for each "global event" emitted from Olo Serve. These custom events map to each of the GA Enhanced Ecommerce activities, and they can be used to pass data from Serve to GA.

Read more about Olo Serve's global data and events here.

Changelog

  • Dec 12, 2023

    • Adding missing measurementIdOverride key that was causing issues while importing the container.
  • Aug 29, 2023

    • Prior to this date, Dispatch orders were not reporting revenue in GA4. This has been fixed on the application side, no action is required.
  • Aug 2, 2023

  • Jul 1, 2023

  • Jan 19th, 2022

  • June 10, 2021

    • Added GA4 support
    • Event name changes
      • productsVisible event became impressions to match UA standard
      • viewProductDetail event became detail to match UA standard
      • clickProductLink event became productClick to match UA standard

Simple Setup

The fastest way to get started with Olo Serve and GTM is to import a container configuration from our Github repository. This will install the Olo Serve GTM templates and add the appropriate triggers, variables, and tags to track interactions with Serve via Google Analytics. The configurations are ideal for new or existing GTM setups. Additionally, they can be used to configure Serve App analytics for iOS and Android.

If you are worried about importing a configuration conflicting with your existing GTM setup, follow one of the manual setup instructions below.

1. Import a container configuration

To import a container configuration, open your GTM container and navigate to the Admin tab.

GTM Workspace Overview GTM Admin

Select one of the JSON configuration downloaded from our Github repository that best suits your needs. In most cases, this will be olo-serve-container-configuration-ga4-web.json as it leverages GA4 and only contains tracking for Serve web.

You can choose which workspace to import the configuration to, and whether or not to merge or overwrite existing tags.

GTM Import Container

2. Configure Google Analytics

Go through each Olo Serve Tag and replace G-000000 with your GA4 Measurement ID.

GTM GA4 settings

3. Verify data is flowing to Google Analytics

Once you have configured Google Analytics, preview your new GTM setup and inspect network traffic or the output of the Google Analytics Debugger Chrome plugin. For each trackable action (see Available Events) you should see corresponding data pushed to GTM and then GA.

GTM preview

3a. Google Analytics 4

GA4 GA debugger output GA4 network traffic

Manual Setup

If using the pre-built container configuration is not desireable for any reason, you can still take advantage of this template by setting it up manually.

GTM home screen

1. Import the Olo Serve template

To start using the Olo Serve GTM template, import it from the Community Template Gallery.

GTM templates GTM template gallery Olo GTM template

2. Configure the Olo Serve Template

The Olo Serve Template is a custom tag that listens for changes in Serve, and then emits dataLayer events that can be used as triggers in GTM.

You can configure the template to work with Google Analytics 4 analytics.

You can find the installed Olo Serve tag under "Custom".

After adding the tag, select which events you'll want forwarded to Google Analytics. This tag should be triggered on all DOM Ready events.

GTM Tags page GTM Choose Tag Type DOM Ready trigger

2a. Google Analytics 4

By selecting GA4, the dataLayer events will match the GA4 Developer's Guide specifications.

Olo Serve GTM Template GA4

2b. Universal Analytics

Deprecated

Starting July 1, 2023, standard UA properties will stop processing data.

2c. Legacy ga.js Analytics

Deprecated

This only supports the transaction event and is only included for backwards compatibility.

3. Add platform variables (optional)

If you want to track Serve web and Serve App events separately, you need to route data from GTM to more than one Google Analytics account. This is covered in more detail under Add Tags, but a prerequisite is to add variables to differentiate between platform. These variables key off device information exposed by Serve.

GTM variables

Adding Is Web? variable Adding Is iOS? variable Adding Is Android? variable

4. Add triggers

Before you add tags for sending data to GA, you need to add triggers that will be fired when an event is pushed to the dataLayer from Serve. A full list of event names are available in the GA4 Developer's Guide specifications.

GTM triggers Choose trigger type Configure custom event

4a. Serve App

If you are using Serve App, you need to differentiate between data from the web and iOS/Android apps. To achieve this, you must define the conditions for when to fire a tag.

Configure custom event for Android

5. Add tags

Adding Google Analytics tags and wiring them to triggers is the final step in taking data from Serve and sending it to Google Analytics.

GTM tags

5a. Google Analytics 4

Add GA4 event Add add_to_cart event

You must define the event parameters as defined in the GA4 Developer's Guide specifications. Add a new variable to map from the dataLayer to what GA4 is expecting.

Add a variable Ecommerce items variable

For the full list of tag configurations, see each "Tag configuration for this example" section in the GA4 Developer's Guide specifications.

Available Events

Event Name Description
addToCart A product is added to the cart.
removeFromCart A product is removed from the cart.
checkout A user proceeds to the Checkout page.
purchase A user has completed their purchase.
productClick A user clicks a product link.
detail A user views the details and/or configures a product.
impressions A product becomes visible on the screen.

Migrating from Firebase

Serve App no longer supports Firebase. Here is a list of events previously tracked in Firebase and how to implement them in GTM.

Firebase Event GTM Implementation
add_to_cart Serve's addToCart event
app_clear_data Not Supported
app_remove Not Supported
app_update Not Supported
BasketCreationError Not Supported
CardScan Not Supported
CreateBasket Available as a Serve Global Event v1.createBasket
ecommerce_purchase Serve's purchase event
Favorite Listen for clicks to the favorite button with GTM
Feedback Listen for clicks to the feedback button with GTM
first_open Available as a Serve Global Event v1.appFirstOpen
Location Available as a Serve Global Event v1.locationAccessAllowed and v1.locationAccessDenied
LoginView Listen for pageview changes with GTM
MainMenu Listen for clicks to the menu button with GTM
os_update Not Supported
screen_view Listen for pageview changes with GTM
session_start Not Supported
User Serve's userLogin event

Some events are not directly supported by these templates because there is no Google Analytics equivalent event. They can be manually integrated by leveraging the dataLayer, tags and triggers. Read more about how to integrate with these events in Olo Serve Global Data and Events.

Adding Serve App Tracking

If you use these templates for integrating tracking into Serve web today, the simplest path to adding support for Serve App is to remove all existing tags, triggers and templates related to older versions of these instructions and import one of the container configurations above.

If that is not an option, the best place to start is adding platform variables, filtering existing tags to only apply to Serve web, and then adding additional triggers and tags for each Serve App platform.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published