/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ function sendAnalyticsEvent (sendData) { if (typeof (ga) == 'function') { ga("Transmatico.send", sendData); } if (typeof (sendDataMatomo) == 'function') { sendDataMatomo(sendData) } } function TRMgetSrcOfBGImage(selector) { var result = ''; selector = jQueryTRM(selector) if (selector.length) { var backgroundImage = selector.css('background-image') if (backgroundImage && backgroundImage != "none") { if (backgroundImage.substr(4, 1) == '"' || backgroundImage.substr(4, 1) == "'") { result = backgroundImage.substr(5, backgroundImage.length - 7) } else { result = backgroundImage.substr(4, backgroundImage.length - 5) } } } return result } var eventReg = [] function TRMEvent() { for (var i = 0; i < eventReg.length; i++) { var reg = eventReg[i] var find = true for (var j = 0; j < arguments.length; j++) { if (reg.p[j] != null && arguments[j] != reg.p[j]) { find = false break } } if (find) { if (reg.dis) { eventReg.splice(i, 1) } reg.f.apply(reg.this, arguments) } } } function TRMEventReg(params, callback, disposible) { eventReg.push({p: params, f: callback, dis: disposible}) } function TRMgetCookie(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); } function TRMcreateCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } var TRMisMobile = function () { var check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera); return check; } var TRMSearch = (function () { var params = {} var query = window.location.search.substring(1); if (query) { var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { if (vars[i]) { var pair = vars[i].split('='); if (pair[0]) { params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); } } } } return { get: function (variable) { if (variable === undefined) { return params } else { return params[variable] } }, set: function (variable, value) { if (variable !== undefined) { if (value === undefined) { delete params[variable]; } else { params[variable] = value } } var str = ''; for (variable in params) { str += '&' + encodeURIComponent(variable) + '=' + encodeURIComponent(params[variable]) } window.location.search = (str ? '?' : '') + str.substr(1) } } })() var TRMHtmlEncode = function (value) { var elm = document.createElement("div") elm.textContent = value return elm.innerHTML; } var TRMHtmlDecode = function (value) { var elm = document.createElement("div") elm.innerHTML = value return elm.textContent; } var TRMLoadGoogleAnalyticsTracking = function () { /** * If google analytics tracking script is not loaded, don't attach any listeners * and abbort bacause tracking for this newspaper is not enabled. */ if (typeof sendAnalyticsEvent != 'function') { return; } /** * Send tracking event to google analytics that the overlay has been opened */ TRMTrackAdEvent('Overlay_Expand'); /** * Attach google tracking events to the buttons */ var elm = document.querySelectorAll('#lightboxAd .menubuttonContainer.phone a') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function () { TRMTrackAdEvent('button_Phone'); }) } } /* * link to website */ /** * If the link open in a new window there is no need to make a javascript redirect. */ var elm = document.querySelectorAll('#lightboxAd .menubuttonContainer.site a[target="_blank"]') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function () { TRMTrackAdEvent('button_URL'); }) } } /** * We nned to redirect the user after the tracking event has been sent, * Othrwise the broser will stop the execution before the tracking event is sent. */ var elm = document.querySelectorAll('#lightboxAd .menubuttonContainer.site a:not([target])') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function (evt) { evt.preventDefault(); TRMTrackAdEvent('button_URL'); window.location = this.getAttribute('href'); }) } } /* * link to map */ var elm = document.querySelectorAll('#lightboxAd .menubuttonContainer.map a') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function (evt) { var target = this.getAttribute("target") if (target != '_blank') { evt.preventDefault(); } TRMTrackAdEvent('button_Maps'); if (target != '_blank') { window.location = this.getAttribute('href'); } }) } } /* * email */ var elm = document.querySelectorAll('#lightboxAd .menubuttonContainer.email a') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function () { TRMTrackAdEvent('button_Email'); }) } } /** * Attach google tracking events to the ad image shown in the overlay and link in below the buttons. * If the link open in a new window there is no need to make a javascript redirect. */ var elm = document.querySelectorAll('#lightBoxcontent a[target="_blank"], #infCont .textInfo a.wbsite[target="_blank"]') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function () { TRMTrackAdEvent('link_URL'); }) } } /** * Attach google tracking events to the ad image shown in the overlay and link in below the buttons. * If the link opens in the same window we need to postpone the redirect in * order to successfully send the tracking event. */ var elm = document.querySelectorAll('#lightBoxcontent a:not([target]), #infCont .textInfo a.wbsite:not([target])') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function (evt) { evt.preventDefault(); TRMTrackAdEvent('link_URL'); window.location = this.getAttribute('href'); }) } } var elm = document.querySelectorAll('#infCont .textInfo a:not(.wbsite)') for (var i in elm) { if (elm[i].addEventListener !== undefined) { elm[i].addEventListener('click', function () { TRMTrackAdEvent('link_Email'); }) } } } /** * Send information about a tacking event to google analytics. * @param String eventAction the string alias to the event type which occured. The alias will be used for the eventAction paramters passed to google. * Possible values: * 1. `Overlay_Expand` - when an ad is clicked * 2. `button_URL` - when the buttons linked to the ad url is clicked ( if present ) * 3. `link_URL` - when the images linked to the ad url is clicked ( if present ) * 4. `button_Phone` - the button with tel: link is clicked ( if present ) * 5. `button_Email` - when the button with mailto: link is clicked * 5. `link_Email` - when the link with mailto: url below the buttons is clicked * 6. `button_Maps` - when the button linking to a google map page is clicked * @returns {undefined} */ var TRMTrackAdEvent = function (eventAction) { if (typeof (sendAnalyticsEvent) == 'undefined') { return; } /** * The default values common for all Events that will be sent to google */ var sendData = { hitType: 'event', eventCategory: 'Default category', eventAction: eventAction, eventLabel: 'Default label' }; switch (eventAction) { case 'Overlay_Expand': /* * FOR TASK 2205 * sending event for advertiser, as event with action "Overlay_expand", category and label = website with title as fallback in case if site does not exists */ var elm = document.querySelector('a.wbsite') if (!elm) { elm = document.querySelector('.textInfo h4') } if (elm) { var title = document.querySelector('.textInfo h4') != null ? document.querySelector('.textInfo h4').innerHTML : ''; var website = document.querySelector('a.website') != null ? document.querySelector('a.website').innerHTML : ''; if (title.length && website.length) { title += ' - '; } var current_src = document.querySelector('#TMAdView #lightBoxcontent img'); var all_ads = document.querySelectorAll('.TRM-RPA-image-container [rel="ad"]'); var find_ad_id = ""; if (all_ads && current_src) { for (var i = 0; all_ads.length > i; i++) { if (current_src.src == all_ads[i].src && all_ads[i].id) { find_ad_id = all_ads[i].id; break; } } } //console.log (find_ad_id); sendData.eventLabel = 'Overlay view (' + decodeURI(title) + decodeURI(website) + ') ' + find_ad_id; sendData.eventCategory = 'Overlay'; //website; sendAnalyticsEvent(sendData); } sendData.eventLabel = 'Overlay view'; sendData.eventCategory = 'Overlay'; break; case 'button_URL': case 'link_URL': case 'button_Phone': case 'button_Email': case 'button_Maps': case 'link_Email': /* * FOR TASK 2205 * sending event for advertiser, as event with action "Overlay_expand", category and label = website with title as fallback in case if site does not exists */ var elm = document.querySelector('a.wbsite') if (!elm) { elm = document.querySelector('.textInfo h4') } if (elm) { var title = document.querySelector('.textInfo h4') != null ? document.querySelector('.textInfo h4').innerHTML : ''; var website = document.querySelector('a.website') != null ? document.querySelector('a.website').innerHTML : ''; if (title.length && website.length) { title += ' - '; } sendData.eventLabel = 'Overlay click (' + decodeURI(title) + decodeURI(website) + ')'; sendData.eventCategory = 'Overlay'; //website; sendAnalyticsEvent(sendData); } sendData.eventLabel = 'Overlay click'; sendData.eventCategory = 'Overlay_Click'; break; case 'Banderole_View' : case 'Banderole_Close' : var prefix = eventAction == 'Banderole_View' ? 'Banderole View' : 'Banderole Close'; var banderoleContentContainer = document.querySelector('.trm-banderole #html_structura_area_v2') sendData.eventLabel = prefix + '(' + (banderoleContentContainer ? banderoleContentContainer.getAttribute('data-trm-project-name') : '') + ')' sendData.eventCategory = prefix; sendAnalyticsEvent(sendData) break; } sendAnalyticsEvent(sendData); };if (window.TRM===undefined) {window.TRM={}};window.TRM[1734997251138783] = JSON.parse("{\"applyAjaxAlias\":0,\"aliasSet\":[\"starke-partner-im-bergischen-27-april-2021\",\"handwerk-in-wuppertal-april-2022\"],\"aliasInfo\":{\"starke-partner-im-bergischen-27-april-2021\":{\"id\":\"69349\",\"name\":\"Starke Partner im Bergischen\",\"hubpage_title\":\"\",\"alias\":\"starke-partner-im-bergischen-27-april-2021\",\"language\":\"\",\"image_id\":\"3240852\",\"pdf_id\":\"0\",\"external_pdf_link\":\"\",\"project_id\":\"0\",\"articleCnt\":\"3\",\"lastCreated\":\"1619495327\",\"maxPublishingDate\":\"28.04.2021\",\"minPublishingDate\":\"1619600435\",\"advertorialDescriptionText\":\"\",\"project\":false,\"maxPublishingDateNeg\":-1619600443,\"minPublishingDateNeg\":-1619600435,\"articleCounterDisplayNone\":\"\",\"imageDisplay\":\"\",\"image\":\"\",\"imageSource\":\"\",\"type\":\"advertorial\",\"index\":0,\"pageCount\":1,\"activeClass\":\"\",\"model\":{},\"href\":\"https:\\/\\/sonderthemen.wz.de\\/starke-partner-im-bergischen-27-april-2021?utm_source=widget&utm_medium=teaser_box&utm_campaign=Starke%2520Partner%2520im%2520Bergischen&utm_term=Mit%2520K%25C3%25BCnstlicher%2520Intelligenz%2520Ressourcen%2520sparen%2520und%2520Produktionen%2520optimieren\",\"advertorialHubpageTitle\":\"\",\"advertorialHubpageTitleEncoded\":\"\",\"title\":\"Starke Partner im Bergischen\",\"titleSource\":\"advertorial\",\"articleTitles\":\"Mit K\\u00fcnstlicher Intelligenz Ressourcen sparen und Produktionen optimieren\",\"advertorialTitle\":\"Starke Partner im Bergischen\",\"advertorialTitleEncoded\":\"Starke Partner im Bergischen\",\"descriptionType\":\"advertorial\",\"teaserList\":\"