var cat_head_params = [{"sponsor":{"headline":"13 Speakers\u20149 Sessions\u20141 Day of Awesome Insights!","font_size":"30","line_height":"1.2","title_span_color":"","region_two_letter_code":"all"},"sponsor_logo":"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2023\/10\/logo-545.png","sponsor_text":"Enjoy talks and panels from some of the industry\u2019s leading experts at BrightLocal\u2019s virtual conference, Local SEO for Good, on September 12.\n","font_size":"17","cta_text":{"text":"Explore The Full Line-Up","font_size":"20"},"tooltip":"Explore the full line-up and secure your ticket today!","colors":{"cta":"#ffffff","cta_bg":"#0fd03b","background":"#fefbf6","head_color":"#000000","text_color":"#000000"},"logo_url":"https:\/\/www.brightlocal.com\/local-seo-for-good\/?utm_source=sej&utm_campaign=local_seo_for_good&utm_medium=sponsorship&utm_content=category","advertiser":"BRIGHTLOCAL","campaign":"BRIGHTLOCAL Q3","promo_label":["SPONSORED"]}]; var if_country_set = false; var display_index = 0; var region_exists = false; for( let i=0; i < cat_head_params.length; i++ ){ let region = cat_head_params[i].sponsor.region_two_letter_code; let regionArray = region.split(','); //console.log('r_ar', regionArray ); //console.log('sg', window.parent.sglob_country ); //console.log('cat_head_params', cat_head_params ); if( region !== 'all' ){ region_exists = true; } if( regionArray.includes( window.parent.sglob_country ) ){ display_index = i; //console.log('dii', display_index); break; }else{ if( region == 'all' && !regionArray.includes( window.parent.sglob_country ) ){ display_index = i; //console.log('dii2', display_index); break; } } } if( !region_exists ){ display_index = Math.floor( Math.random() * ( cat_head_params.length ) ); } //console.log('r_ex', region_exists); //console.log('d_ii3', display_index); cat_head_params = cat_head_params[display_index]; var scheader = document.getElementById( "sch" ); var total_html = ''; if( cat_head_params.sponsor_logo && cat_head_params.sponsor_text ){ scheader.style.backgroundColor = cat_head_params.colors.background; scheader.style.color = cat_head_params.colors.text_color; details_start = '
'; details_end = '
'; h3_html = '

'+cat_head_params.sponsor.headline+'

'; cta = ''+cat_head_params.cta_text.text+'' atext = '

'+cat_head_params.sponsor_text+'

'; logo_html = ''; promo_label = ''; if( typeof cat_head_params.promo_label != 'undefined' && cat_head_params.promo_label ){ promo_label = ''+ cat_head_params.promo_label + '' } total_html = details_start+h3_html+atext+cta+details_end+logo_html+promo_label; sappendHtmlv2( scheader, total_html ); slinks = scheader.getElementsByTagName( "a" ); setTimeout(() => { if( "undefined" != typeof window.parent.dataLayer ){ window.parent.dataLayer.push({ event: 'virtualpageview_spons_cat', virtualpageurl_category: '/tsp_'+cat_head_params.logo_url, virtualpagtitle_category: cat_head_params.sponsor.headline, category_spons_advertiser: cat_head_params.advertiser, category_spons_campaign: cat_head_params.campaign, category_spons_topic:'seo', category_spons_site_section: window.parent.scategory, category_spons_path: window.parent.location.pathname }); if( typeof slinks != 'undefined' ) { for (var i = 0, len = slinks.length; i < len; i++) { slinks[i].addEventListener('click', function(e) { window.parent.dataLayer.push({ event: 'event_spons_cat', event_spons_cat_category: 'Sponsored Category Clicks', event_spons_cat_headline: cat_head_params.sponsor.headline, event_spons_cat_action: 'seo', event_spons_cat_label: cat_head_params.logo_url, event_spons_cat_sponsor: cat_head_params.advertiser, event_spons_cat_site_section: window.parent.scategory, event_spons_cat_location_pathname: window.parent.location.pathname, event_spons_cat_campaign: cat_head_params.campaign }); window.parent.__gaTrackers( "send","event", "Sponsored Category Click Var 1", "seo", cat_head_params.logo_url ); }); } } } }, 1500); } // endif cat_head_params.sponsor_logo