(function (Kiro, head) { "use strict"; Kiro.add( "tagManager", { version: "1.0.0", depend: [ { jq: "1.10.1", test: function () { return typeof jq1101 === "function"; }, failure: ["/static-tr/c1/j/lib/jquery/1.10.1/jquery-min.js"], }, ], }, function ($) { var init = function () { if (typeof edLayer !== "undefined") { downloads(); tracking(); } }, textClean = function (txt) { if (typeof txt === "undefined" || txt === null) { return ""; } return $.trim(txt) .replace(/\s{2,}/g, " ") .replace(/\s/g, "_") .toLowerCase(); }, downloads = function () { $("a").each(function (e) { var $t = $(this), href = $t.attr("href"), ext, text; if (typeof href !== "undefined" && href !== null) { ext = href.split(".").pop().toLowerCase(); text = $.trim($t.text()).replace(/\s{2,}/g, " "); if (href.substring(0, 16) === "/static-tr/c1/file/") { $t.bind( "click.gaEventTracking", (function (ext, text) { return function () { edLayer.push(["Download", ext, text]); }; })(ext, text) ); } } }); }, tracking = function () { if ($("body").hasClass("any3")) { tagManagerTracking("any3"); } }, tagManagerTracking = function (layout) { var $t, $ta, label, num, ind, w, s, p, e, c; if (layout === "any3") { $("#crossSiteNav > a, #toolsMenu > a").each(function (e) { $t = $(this); label = textClean($t.text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label) { return function () { edLayer.push(["trackTeaser", label + "-click", "top"]); }; })(label) ); } }); // top $("#mainMenu a").each(function (e) { $t = $(this); label = textClean($t.text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label) { return function () { edLayer.push(["trackTeaser", label + "-click", "navi1"]); }; })(label) ); } }); // navi1 $(".customContent a", "#mainPromoCarousel").each(function (e) { $t = $(this); s = $t.closest(".slide").index(); label = textClean($(".pagerWrapper > nav > a").eq(s).text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label, s) { return function () { edLayer.push([ "trackTeaser", label + "-click", "s" + (s + 1) + "_main_e:title", ]); }; })(label, s) ); } }); // sx_main_e $(".promoBox", "#mainPromoCarousel").each(function (e) { $t = $(this); if (!$t.hasClass("transparent")) { s = $t.closest(".slide").index(); p = $t.index() - $t.siblings(".transparent").length; label = textClean($t.find("h3").text()); e = "title"; if ($t.hasClass("simpleWide")) { w = 1; } else if ($t.hasClass("doubleWide")) { w = 2; } else if ($t.hasClass("trebleWide")) { w = 3; } else { w = 4; } if (label === "" && $t.has("img")) { label = $t.find("img").prop("alt"); e = "img"; } if (label !== "") { $t.bind( "click.gaEventTracking", (function (label, s, p, w, e) { return function () { edLayer.push([ "trackTeaser", label + "-click", "s" + (s + 1) + "_p" + (p + 1) + "_w" + w + "_e:" + e, ]); }; })(label, s, p, w, e) ); } } }); // sx_px_wx_e $("a", ".portal-links").each(function (e) { $t = $(this); label = textClean($t.text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label) { return function () { edLayer.push(["trackTeaser", label + "-click", "rx"]); }; })(label) ); } }); // rx $(".follow-us-on a", "#pFooter").each(function (e) { $t = $(this); label = textClean($t.text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label) { return function () { edLayer.push(["trackTeaser", label + "-click", "f1"]); }; })(label) ); } }); // f1 $(".nav.horizontal a", "#pFooter").each(function (e) { $t = $(this); label = textClean($t.text()); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label) { return function () { edLayer.push(["trackTeaser", label + "-click", "f2"]); }; })(label) ); } }); // f2 $(".nav.vertical a", "#pFooter").each(function (e) { $t = $(this); label = textClean($t.text()); c = $t.closest(".vertical").index(); if (label !== "") { $t.bind( "click.gaEventTracking", (function (label, c) { return function () { edLayer.push([ "trackTeaser", label + "-click", "f3_c" + (c + 1), ]); }; })(label, c) ); } }); // f3_cx } // any3 }; return { run: function () { setTimeout(init, 300); }, }; } ); Kiro.ready(function () { var tm = Kiro.get("tagManager", "1.0.0"); tm.run(); }); })(Kiro, head);