How to set up Goal Tracking using Google Tag Manager

Lisa Fockens Updated by Lisa Fockens

If you want to track goals (e.g., purchases or sign-ups) on your website, you can use Google Tag Manager (GTM) to set up goal tracking. Here's how:


To ensure that goal tracking works properly, you need to fire your "Wisepops setup code" tag before your "goal" tag. Here's how to adjust the tag priority:

  1. Open the "setup code" tag in Google Tag Manager.
  2. Click "Advanced Settings".
  3. Set the "priority" of the "setup code" tag to 1.

In this tutorial, we'll assume you have a confirmation page associated with your goal. If you don't, please contact us, we'll suggest a different method.

Step-by-Step Instructions

  1. Log in to your GTM account.
  2. In the left-hand menu, click "Triggers" and then "New."
  3. Configure your trigger using the following settings:
    • Type: Dom Ready
    • Fire on: Some DOM Ready Events
    • Page URL: [Input the URL of your confirmation page here.]
    • Trigger Name: [Choose an explicit name for your trigger.]
  4. In the left-hand menu, select "Tags" and click "New."
  5. Under tag configuration, select "Custom HTML."
  6. In the HTML field, paste the Javascript snippet provided to you when you create a goal and customize it:

Replace the revenue value with a variable that make sense to you. You likely want to retrieve the revenue from your data layer.

  1. In the triggering section, select the trigger you just created.
  2. Name and save your new tag.
  3. Preview the changes to make sure that the tag fires correctly on your confirmation page.
  4. When finished, click "Publish" to apply the changes to your website.

If you have any questions, please get in touch.

How to Set Up Goal Tracking in Magento