Installing the accessibility widget using Google Tag Manager

Google tag managerStep 1: Register your site and obtain a token

If you are installing the plugin for the first time, register using Google, Facebook or use your own email address and password. wcag register form After creating an account, go to the “My Sites” tab, and then click the button “Add new”. wcag my sites In the form for adding a new page, enter the addresses of the websites where you want to apply the token. If your site runs on a domain such as example .com and e.g. www. example.com then it is necessary to add both addresses. Read more about this in the documentation. Finally, click the "Save" button and copy the generated token. wcag copy token

Step 2: Adding the DockWCAG widget using GTM

1. Log in to Google Tag Manager

Go to https://tagmanager.google.com/ and select the appropriate container for your website.

GTM - container


2. Add a new tag

Click the “Add new tag” button.

GTM - new tag


3. Select the tag type – Custom HTML

  1. Give the tag a name, e.g. DockWCAG - Widget.

  2. Click on the “Tag configuration” field and select “Custom HTML code.”

GTM - custom html


4. Paste the widget code

Paste the following code into the HTML editing field and replace _TOKEN_ with your unique token generated in the previous step:

<script>
    (function (d, s, t) {
        var f = d.getElementsByTagName(s)[0],
            j = d.createElement(s),
            a = new Date().getTime();
        j.async = true;
        j.src = '//wcag.dock.codes/accessibility/' + t + '/start.js?t=' + a;
        f.parentNode.insertBefore(j, f);
    })(document, 'script', '_TOKEN_');
</script>

GTM - custom html widget


5. Set the startup trigger

Click on the “Triggering” field and select the “All Pages” rule so that the widget loads on every subpage.

GTM - regule all pages


6. Save and publish

Click “Save,” then ‘Submit’ and “Publish” to publish your changes to GTM.

GTM - publish

Step 3: Preview the site

After adding the script, test your site to make sure the widget is properly installed and works as expected. Check all the widget’s functions to verify that the installation was successful.

 

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.