How to add an HTML script to the header of eDirectory?
As a site manager, there may be times when you wish to enhance your eDirectory site by adding an additional feature that requires a script. Many platforms and tools—such as analytics, pixels, or verification services—request users to place specific scripts in the header of a website so that the script can function correctly.
In this article, we’ll walk you through two different methods to achieve this:
- Adding a script through the Site Manager Area.
- Using Google Tag Manager (GTM) for site-wide implementation.
Option 1: Site Manager Area
This method allows you to insert scripts directly into a specific page of your website.
Steps:
- Go to Design → Page Editor in your Site Manager.
- Select the page you want to edit (e.g., the homepage).
- Click on “Show SEO and Advanced Options.” This will expand additional fields.
- Under Add a tag on page header, paste the custom script you want to insert into the page header and save changes.
Please note: Using this method will only apply the script to the page you edit (e.g., the homepage). If you want the script to be active across your entire website, you’ll need to manually repeat this process for every page.
For a more practical solution that applies scripts to all pages at once, consider Option 2.
Option 2: Google Tag Manager (Recommended)
Google Tag Manager (GTM) provides a more efficient way to manage scripts across your entire eDirectory website. With GTM, you can configure triggers that apply scripts to all pages, eliminating the need to manually edit each one.
Step 1: Verify GTM is Installed
Before adding scripts, make sure GTM is properly set up on your site. If you haven’t configured GTM yet, please follow our guide: How to Configure Google Tag Manager (complete steps up to Step 4).
Step 2: Add a New Script in GTM
Once GTM is active on your site:
- In your GTM dashboard, go to Tags (left-hand menu).
- Click New to create a new tag.
- Click on the "Tag Configuration"
- Under Tag Configuration, select Custom HTML.
- Provide a descriptive Tag Name (e.g., “Facebook Pixel”).
- Paste your script code into the HTML field.
- In the Triggering section, choose All Pages so the script runs site-wide.
- Click Save.
Step 3: Publish the Tag
- Click Submit (top right of the GTM dashboard).
- Add a Version Name (e.g., “Added Facebook Pixel”) and optionally a description.
- Click Publish to make the script live on your eDirectory site.
- You’ll see a confirmation message once the tag has been successfully published. From that moment, your script will be applied to all pages of your site.
Please, check out a few examples of scripts you can add with Google Tag Manager in the following articles:
Final Thoughts
Adding scripts to the header of your eDirectory site can unlock powerful integrations and tracking features. If your script is only needed on one or two pages, Option 1 (Site Manager Area) may be sufficient. However, for site-wide implementation and easier management, we strongly recommend using Google Tag Manager.