Tracking via Google Tag Manager

Learn how to set up Ours Privacy tracking via GTM without installing the web script. Securely track events and manage PHI/PII flow with our HIPAA-compliant solution.

Overview

The Ours Privacy GTM template provides a simple way to integrate tracking on your site without needing to install the web sdk manually. By using the GTM template, you can easily send track and identify calls to Ours without writing code.



How to track using Google Tag Manager

Today, use Ours Privacy in GTM using the instructions below.

  1. Create the Ours Privacy template in GTM: Download the Ours Privacy GTM template from Github here: Ours GTM Template and upload it in GTM by going to Templates > Tag Templates > New
  2. Save your Ours Privacy token as a variable in GTM: In GTM, set your Ours Privacy token as a variable by going to Variables > User-Defined Variables > New. The variable type should be a Constant. You can find your GTM Token in Ours Privacy by going to Installing Ours > Copy GTM Token.
  3. Create a GTM tag to install Ours Privacy: Create a tag by going to Tags > New. Under Project Token, insert your new Ours Privacy token variable. Choose the Install Action. Your trigger should be Initialization - All Pages.
  4. Create tags to track events or identify users: To track an event, create a new Tag and insert your under Project Token, insert your Ours Privacy token variable; choose the Track Action. To identify a user, choose the Identify Action. See below for more on event properties, user properties and default properties.
  5. Add your events to your Allowed Events list in Ours Privacy: After previewing your site and verifying that the tags are firing, log into your Ours Privacy portal and view them in the Recent Events view. Then, go to your destinations and add the same event names you are sending from GTM to your Allowed Events list as you'd like.


Step 1: Create the Ours Privacy template in GTM



Step 2: Save your Ours Privacy token as a variable in GTM

  1. Log in to your Ours Privacy account and navigate to the Installing Ours page.
  2. Press the Copy GTM Token button to put your Ours Privacy token on your clipboard
  3. Paste it into the Project Token field when configuring the Ours Privacy tag in GTM.


Step 3: Create a GTM tag to install Ours Privacy

The Ours GTM template has an "Install" action. The first tag you should create in GTM is to fire an Ours Tag with the Install action. You should trigger it upon initialization since you want Ours to be installed as early as possible to capture more query parameters and data.



Step 4: Create tags to track events or identify users

When tracking an event, you can specify the event name. This will be the name you "allow" in your Allowed Events list.

You can also pass along any event properties, or user properties. In Ours, user properties are selected from a dropdown list. This way, all of your PHI is stored in a known location and Ours can easily modify it before sending it to a destination.


Overriding Default Properties

The Ours GTM template also allows you to specify fallbacks and overrides for the default properties we collect about visitors. This can be useful if you sometimes have Click ID or other data stored in GTM Variables that should override what we would detect on the page.


Identifying Users

If you just wish to identify some property about the user without sending an event, you can use the identify action. This will update the users properties without sending an event.


Manual Event Tracking

If you need to track events programmatically, you can still use the ours('track', 'EventName') function, even when installed via GTM. The SDK remains accessible globally, allowing you to send custom events manually.



Step 5: Add your events to your Allowed Events list in Ours Privacy

After previewing your site and verifying that the tags are firing, log into your Ours Privacy portal and view them in the Recent Events view. Then, go to your destinations and add the same event names you are sending from GTM to your Allowed Events list as you'd like. See Allow Listing Events for instructions.



Data Flow and Privacy Compliance

The GTM template does not alter how data flows in the Ours Privacy system. All PHI/PII and event data flow directly to Ours Privacy’s secure infrastructure before being processed or sent to any external destinations. This ensures compliance with HIPAA and other privacy regulations.


Consent

If you'd like, you can fire the tag with the Install action before consent is granted and then only fire tags with Track or Identify actions after consent is granted. This is an optional set-up and is up to your preference and business needs.



Why You Don’t Need to Install the Web SDK

When using the GTM template, the Ours Privacy Web SDK automatically initializes itself the first time a tag using it fires. This eliminates the need to manually paste the tracking script into your site’s code. Once GTM is set up, you can focus on configuring your events and identifying users via the GTM UI.



Testing and Publishing

  1. Test your tags using GTM’s Preview mode.
  2. Verify that events are being sent correctly to Ours Privacy.
  3. Publish your GTM container once testing is complete.


Key Benefits of the GTM Template

  • No Script Installation: Avoid modifying your site’s code by using GTM to handle integration.
  • Quick Setup: Simply copy your token and configure events in GTM.
  • Flexible Tracking: Use both automated GTM tags and manual tracking via ours('track', 'EventName').
  • Privacy Assurance: Ensure PHI/PII flows securely to Ours Privacy, maintaining compliance with HIPAA and other regulations.

For more details and support, visit: