Accessibility Helper Tag for Google Tag Manager
Audits current webpage accessibility using ACE and pushes results to dataLayer.
Add a new custom HTML tag and paste code. Fire on every page load or use any condition to take only a sample.
dataLayer.push({
event: "aceCheckResults",
aceResults: {
count: 3,
summary: "aria_content_in_landmark: <ul id=\"skiplinks\"> | aria_navigation_label_unique: <na" +
"v class=\"clearfix\" id=\"navback\"> | aria_navigation_label_unique: <nav class=\"f" +
"cnt fcntn\" id=\"lftr\">",
source: "FRESH",
settings: {resultTypes: ["FAIL"], rules: ["VIOLATION"]},
details: [
{
ruleId: "aria_content_in_landmark",
value: ["VIOLATION", "FAIL"],
node: "HTMLUListElement: html.no-js > body > ul#skiplinks",
path: {dom: "/html[1]/body[1]/ul[1]", aria: "/document[1]/list[1]"},
ruleTime: 0,
reasonId: "Fail_1",
message: "Content is not within a landmark element",
messageArgs: [],
apiArgs: [],
bounds: {left: -2971, top: 0, height: 49, width: 189},
snippet: "<ul id=\"skiplinks\">",
category: "Accessibility"
},
{
ruleId: "aria_navigation_label_unique",
value: ["VIOLATION", "FAIL"],
node: "HTMLElement: html.no-js > body > nav.clearfix#navback",
path: {dom: "/html[1]/body[1]/nav[1]", aria: "/document[1]/navigation[1]"},
ruleTime: 1,
reasonId: "Fail_1",
message: "Multiple elements with \"navigation\" role do not have unique labels",
messageArgs: [""],
apiArgs: [],
bounds: {left: 0, top: 120, height: 43, width: 801},
snippet: "<nav class=\"clearfix\" id=\"navback\">",
category: "Accessibility"
},
{
ruleId: "aria_navigation_label_unique",
value: ["VIOLATION", "FAIL"],
node: "HTMLElement: html.no-js > body > footer.clearfix#footer > div.ctframe.clearfix > n" +
"av.fcnt.fcntn#lftr",
path: {
dom: "/html[1]/body[1]/footer[1]/div[1]/nav[1]",
aria: "/document[1]/contentinfo[1]/navigation[1]"
},
ruleTime: 0,
reasonId: "Fail_1",
message: "Multiple elements with \"navigation\" role do not have unique labels",
messageArgs: [""],
apiArgs: [],
bounds: {left: 15, top: 2485, height: 206, width: 771},
snippet: "<nav class=\"fcnt fcntn\" id=\"lftr\">",
category: "Accessibility"
}
]
},
gtm.uniqueEventId: 8
})
example in preview