Installing the Act-On Beacon with Google Tag Manager

  • Updated

Adding beacon codes for different domains using Google Tag Manager (GTM) involves creating tags for each beacon code and setting up triggers that fire these tags when users visit the specified domains.

  • These steps use GTM but will work with minor changes for other tag managers
  • For a holistic opt-in/opt-out cookie management solution using GTM, see our step-by-step cookie consent guide

Here's a step-by-step guide on how to do this:

Step 1: Set up a Container in GTM

  1. Sign up and log in to GTM.
  2. To create a container for your website/domain, from the GTM dashboard, click the dropdown arrow next to the container name in the top right corner.
  3. Select Create an Account.
  4. Click Create Container.
  5. Enter a name for the container.
    It's good practice to name it after the domain it will be associated with, for example, "example.com".
  6. Select the target platform. Choose Web for websites.
  7. Click Create.

Step 2: Copy & Install Container Code on Website

After creating the container, you'll be prompted to install the container code on your website.

  1. In Act-On, navigate to Settings > Other Settings > Beacon Settings
  2. If needed, change the tracking mode.
  3. Copy the Beacon script provided.
  4. Log in to your website management system (e.g. WordPress).
  5. Paste the container code into the <head> section of every website page associated with this container.
Ensure that the container code is installed correctly and is present on all pages of the website.

Step 3: Configure Tag in GTM

  1. Go back to GTM and navigate to your newly created container.
  2. Click Tags in the left sidebar.
  3. Click New to create a new tag.
  4. Click Tag Configuration and select Custom HTML.
  5. Paste the Act-On Beacon Tracking code into the HTML text area.
  6. Click Triggering.
  7. Click the + icon to create a new trigger.
  8. Choose Page View as the trigger type.
  9. Configure the trigger to fire on specific domain(s).

Step 4: Configure Trigger in GTM

You need to configure triggers to ensure the beacon code fires only on the specified domain.

  1. In GTM, click Triggers in the left sidebar.
  2. Click New to create a new trigger.
  3. Click Trigger Configuration and select Page View.
  4. Under Triggering, choose Some Page Views.
  5. Set the condition to fire the trigger on all pages of the specified domain:
    • Select Page Hostname from the first dropdown.
    • Choose matches RegEx from the second dropdown.
    • In the field, enter the regular expression for the domain. For example, if your domain is example.com, you would enter ^.*\.example\.com$ to match all subdomains and paths.
  6. Give the trigger a name, such as "Act-On Beacon for All Pages - example.com"
  7. Click Save.

Step 5: Attach Trigger to the Beacon Tag

  1. Go to the tag that contains the Act-On beacon code.
  2. Click Triggering.
  3. Click Add Trigger.
  4. Select the trigger you created in Step 4 from the list of triggers.
  5. Click Save.

Step 6: Publish Your Container

  1. Once you enable preview mode, visiting your website will launch a panel with GTM information that is visible to you only. You will see if your new tag is firing and can do any necessary troubleshooting
  2. Once you've confirmed that the beacon code is working correctly, click Submit to publish your changes. They will go live immediately.
  3. Add a version name and description, then click Publish.

Following these steps will ensure that the beacon code is included and fires on all pages within the specified domain, allowing for comprehensive tracking across the entire domain.

Was this article helpful?

Have more questions? Submit a request