What is Crypto? A Beginner’s Guide to Cryptocurrency

[]
=m&&clearInterval(l);”undefined”!==typeof window.__uspapi&&window.__uspapi(“getUSPData”,1,function(a,d){d&&(clearInterval(l),window.isCCPAConsentGiven=”1YNN”===a.uspString,g())});m-=50},50);window.isCCPAConsentGiven=”1YNN”===b(“usprivacy”); }).call(this); ]]> What is Crypto? Cryptocurrency Guide – Investing.com {let c=document.cookie.split(“;”);for(let b=0;b { cid = getCookie(‘_ga'); if(!cid) return null; cid = cid.split(‘.'); return cid.splice(cid.length – 2, 2).join(‘.'); } let firstLevel = secondLevel = “/”; if(location.pathname.split(‘/').filter(a => a).length){ firstLevel = location.pathname.split(‘/').filter(a => a).shift(); secondLevel = location.pathname.replace(firstLevel, ”).replaceAll(‘/', ”); } let params = { ‘event' : ‘GTM page to GA', ‘client_name' : ‘inv-wordpress', ‘environment' : ”, ‘first_level' : firstLevel, ‘second_level' : secondLevel, ‘page_type' : ‘wordpress', ‘edition' : ‘1', ‘smd' : getCookie(‘smd'), ‘page_name' : location.pathname, ‘udid' : getCookie(‘udid'), ‘udid_created' : getCookie(‘firstUdid') ? getCookie(‘firstUdid') : 0, } if(cid = getCid()){ params = Object.assign(params, { ‘cid' : cid, }) } window.dataLayer= window.dataLayer|| []; dataLayer.push(params); } investingIdentityGTM(); ]]> { const lowercaseObjectValues = obj => { for (let key in obj) { if (typeof obj[key] === ‘string' && key!== ‘event' && key!== ‘event_name') { obj[key] = obj[key].toLowerCase(); } } return obj; }; const getDataLayerEvent = el => { return { event: ‘genericEvent', event_name: ‘directory_academyComponent_clicked', action_cd: ‘click', product_feature: null, page_name: ‘What is Crypto? A Beginner’s Guide to Cryptocurrency', content_id: ‘131', event_cd_description2: ‘component name', event_cd_value2: ‘academy_hyperlink', page_type: ‘wordpress' }; } Array.from(document.querySelectorAll(‘.entry-content a')).forEach(element => { const pattern = /investing.com/brokers/([^?n]*)?(?)?/i; const url = element.getAttribute(“href”); const match = url.match(pattern); if (match) { const utm = ‘utm_source=investing&utm_campaign=academy&inv_campaign_id=1&inv_campaign_name=academy&utm_medium=direct&origin=investing'; element.href = `${url}${match[2] === ‘?' ? ‘&' : ‘?'}${utm}`; element.addEventListener(‘click', e => { const gtmEvent = lowercaseObjectValues(getDataLayerEvent(element)); window.dataLayer = window.dataLayer || []; window.dataLayer.push(gtmEvent); // to prevent the event from bubbling up in case the element is nested in another clickable element e.stopPropagation() }); } }); })(); ]]> { input.addEventListener(‘click', (e) => { // hide show containers Array.from(containers).forEach(container => { if (e.target.classList.contains(container.dataset.tab)) { container.classList.add(‘active'); } else { container.classList.remove(‘active'); } }); // remove current class from all tabs Array.from(inputs).forEach(input => { input.classList.remove(‘active'); }); // add current class to the current tab e.target.classList.add(‘active'); }); }) })(document); ]]> { if (typeof jQuery !== ‘undefined') { jQuery(document).ready(function ($) { function trackingLpPro() { function extractActionType(el){ if(el.hasClass(‘mobile-stripe-content')){ return ‘sticky_banner_bottom'; } if(el.hasClass(‘desktop-stripe-content-link')){ return ‘strip'; } if(el.has(‘img').length) { return ‘banner'; } return ‘anchor_text'; } function genreateEventLabel(objectType) { if (objectType == ‘anchor_text') return ‘inv_in_article_anchor_academy'; if (objectType == ‘banner') return ‘inv_in_article_banner_academy'; if (objectType === ‘strip') return ‘top_strip'; if (objectType === ‘sticky_banner_bottom') return ‘inv_pro_academy_sticky_banner_bottom'; return ”; } //extract clear value function extractInnerHtml(el){ value = el.html(); value = value.replace( /(]+)>)/ig, ”); return value.replace(/^s+|s+$/gm,”).replaceAll(‘n', ‘ ‘).replaceAll(‘-‘, ‘_'); } function genreateUITemplate(objectType, el) { switch (objectType) { case ‘anchor_text': code = '43'; text = extractInnerHtml(el); break; case ‘banner': code = '44'; text = extractInnerHtml(el); break; case ‘sticky_banner_bottom': code = ‘none'; text = ‘discover_propicks_cta_button'; break; default: code = ‘none'; text = ‘none'; break; } return `${code}-none-none-${text}-none-none-none-none`; } function genereatePageType(obj) { if (obj == ‘sticky_banner_bottom' || obj == ‘strip') return ‘wordpress'; return ‘crypto' } function lowercaseObjectValues(obj) { for (let key in obj) { if (typeof obj[key] === ‘string') { obj[key] = obj[key].toLowerCase(); } } return obj; } $(‘.site-container, .desktop-stripe-content, .mobile-stripe').on(‘click', ‘a', function(e) { const pro_link = $(this).attr(‘href'); if (pro_link.includes(‘/pro/') || pro_link.includes(‘/pro?')){ const object = extractActionType($(this)); if(! [‘anchor_text'].includes(object) && ! [‘banner'].includes(object) && ! [‘strip'].includes(object) && ! [‘sticky_banner_bottom'].includes(object)) { return; } const eventLabel = genreateEventLabel(object); const ui_template = genreateUITemplate(object, $(this)); const pageType = genereatePageType(object) const [first_level, second_level, third_level] = location.pathname.split(‘/').filter(Boolean); let gtmObject = { event: ‘click on investing pro hook', event_name_cd: ‘click_on_investing_pro_premium_hook', GA_event_action: ‘click on investing pro hook', GA_event_category: ‘inv pro premium', action_cd: ‘click', product_feature: null, page_type: pageType, page_name: ‘What is Crypto? A Beginner’s Guide to Cryptocurrency', content_id: ‘131', event_cd_description1: ‘destination URL', event_cd_value1: $(this).attr(‘href'), referral_component: eventLabel, eventLabel, first_level: first_level || null, second_level: second_level || null, third_level: third_level || null, object, ui_template, }; gtmObject = lowercaseObjectValues(gtmObject); gtmObject.event = ‘GTM event to GA'; // bring back the original event name window.dataLayer = window.dataLayer || []; window.dataLayer.push(gtmObject); localStorage.setItem(‘investing.referralComponent', eventLabel); e.stopPropagation() } }) } trackingLpPro(); }); } }) ]]>

Source

Leave a Reply

Your email address will not be published. Required fields are marked *