PageSourceSearch

https://www.deutsche-glasfaser.de/blog/wp-content/themes/DeutscheGlasfaser/js/gtm-push.js

js deutsche-glasfaser.de collected 2026-10-02 14:37:40 UTC 1,829 bytes, 41 lines download raw bytes

1(function(window, $) {
2    "use strict";
3
4    function getCurrentCategoryFromPageMenu() {
5        return $('#header--megaMenu li.active a.nav-link, #header--megaMenu li.current-post-ancestor a').eq(0).text().replace('#', '').toLowerCase();
6    }
7
8    function getGtmContentId() {
9        var contentId = "DG" + window.location.pathname.replace(/\//g, ".").toLowerCase() + "blogpage";
10        if( (window.location.pathname == "/blog" || window.location.pathname == "/blog/" ) && !window.location.search.match(/&?s=/))
11            contentId = "DG.blog.startseite.blogpage";
12        else if( (window.location.pathname == "/blog" || window.location.pathname == "/blog/" ) && window.location.search.match(/&?s=/))
13            contentId = "DG.blog.archive.blogpage";
14        else if ( !contentId.startsWith("DG.blog.category") && !contentId.startsWith("DG.blog.events") )
15            contentId = contentId.replace("DG.blog.", "DG.blog.category." + getCurrentCategoryFromPageMenu() + ".");
16
17        return contentId;
18    }
19
20    $(document).ready(function() {
21        setTimeout(function () {
22            var contentId = getGtmContentId();
23            var contentGroupsDict = {};
24            var contentGroups = contentId.split('.');
25
26            for(var i = 0; i<contentGroups.length-1; i++)
27                contentGroupsDict['contentGroup'+(i+1).toString()] = contentGroups[i];
28
29            var dataLayerEvent = {
30                'event': 'project-page-data',
31                ...contentGroupsDict,
32                'contentId': contentId,
33                'currentPage': contentGroups.slice(-2)[0],
34                'pageType': contentGroups.slice(-1)[0]
35            };
36
37            window.dataLayer.push(dataLayerEvent);
38//            console.log("EVENT-PROJECT-PAGE-DATA:", dataLayerEvent);
39        }, 500);
40    });
41})(window, jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.