if(typeof MTVN=="undefined")MTVN={}; if(typeof MTVN.config=="undefined")MTVN.config={}; if(typeof MTVN.config.btg=="undefined")MTVN.config.btg={}; //if(typeof MTVN.config.cmt=="undefined")MTVN.config.cmt={}; //if(typeof MTVN.config.cmt.pageValues=="undefined")MTVN.config.cmt.pageValues={}; var path = window.location.pathname; var rawqs = window.location.search; var hash = window.location.hash; if (path == null) { path = "/"; } else if (path.charAt(0) != "/") {path = "/" + path; } path=path.replace(/\/\/+/g, "/"); pathparts = path.split("/"); parts = (pathparts.length - 1); //since we start with a /, first element is always "" //reporting values setup repParts = pathparts.slice(1); //cut off leading / //dog an beth is a show in the wrong place, change its reporting if(repParts[0]=="dog-and-beth-on-the-hunt"){ repParts.splice(0,0,"show"); parts++; } if (parts==1) { //homepage repParts[0]="home"; repParts[1]="index.jhtml"; } else if (parts==2) { //hub repParts.splice(1,0,"main"); if(repParts[2]==""){ repParts[2]="index.jhtml"; } } else if (parts>2) { //everything else if(repParts[parts-1]==""){ repParts[parts-1]="index.jhtml"; } if(repParts[1]=="dyn"){ repParts.splice(1,1); } } reportingURI=repParts.join("/"); if (! (typeof console === "undefined" || typeof console.log === "undefined")) { console.log("parts="+parts+" reportingURI="+reportingURI); } var if_nt_Screen_Attr = screen.height + "x" + screen.width + "x" + screen.colorDepth; var if_nt_Flash = flashVersion; var qs = queryStringToObject(rawqs); //if (! (typeof console === "undefined" || typeof console.log === "undefined")) { //console.log("qs="); console.log(qs); //} // Yahoo Partner Overrides if(document.referrer.indexOf("yahoo")>=0) { partner="yahoo"; } function queryStringToObject(qs) { var result={}; if (qs != null) { if ( qs.charAt(0) == "?") { qs = qs.slice(1); } var pairs = qs.split('&'); for (i=0; i= 0 || location.href.indexOf("details") >= 0) { //if there is a testmode or details param set, don't refresh ads vmn_page_data["settings"]["reload"] = false; } if (qs.testmode) { vmn_page_data["mappings"]["key-values"]["testmode"] = qs.testmode; } if (path == "/" || path == "/index.jhtml") { //homepage vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["exclusion-categories"] = "home"; //vmn_page_data["settings"]["reload"] = false; } else if (path.lastIndexOf("/news/",0) === 0) { //news section vmn_page_data["metadata"]["hub"] = "news"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; if (path == "/news/" || path == "/news/index.jhtml") { //main page vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["exclusion-categories"] = "hub_pages"; } else if ( pathparts[2] == "this_day_in_country_music") { //this day in country music page vmn_page_data["metadata"]["franchise"] = "day_in_country_music"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["metadata"]["section"] = "home"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; } else { //news article page //vmn_page_data["metadata"]["content_id"] = pathparts[3]; vmn_page_data["metadata"]["article_id"] = pathparts[3]; //vmn_page_data["mappings"]["key-values"]["content_id"] = "@content_id"; vmn_page_data["mappings"]["key-values"]["article_id"] = "@article_id"; } } else if (path.lastIndexOf("/music/",0) === 0) { vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; if ( pathparts[2] == "radio") { //radio section vmn_page_data["metadata"]["hub"] = "radio"; if (path == "/music/radio/" || path == "/music/radio/index.jhtml") { //main page vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["exclusion-categories"] = "hub_pages"; //vmn_page_data["settings"]["reload"] = false; } } else { //music section vmn_page_data["metadata"]["hub"] = "music"; if (path == "/music/" || path == "/music/index.jhtml") { //main page vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["exclusion-categories"] = "hub_pages"; } else if ( pathparts[2] == "concrete-country") { //concrete country (+ add to custom override for video) vmn_page_data["metadata"]["franchise"] = "concrete_country"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if ( path == "/music/concrete-country/" || path == "/music/concrete-country/index.jhtml") { vmn_page_data["metadata"]["section"] = "home"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; } } else if ( pathparts[2] == "live-at-cmt") { //live @ cmt (+ add to custom override for video) vmn_page_data["metadata"]["franchise"] = "live_at_cmt"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if ( path == "/music/live-at-cmt/" || path == "/music/live-at-cmt/index.jhtml") { vmn_page_data["metadata"]["section"] = "home"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; } } else if ( pathparts[2] == "unplugged") { //unplugged (+ add to custom override for video) vmn_page_data["metadata"]["franchise"] = "unplugged"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if ( path == "/music/unplugged/" || path == "/music/unplugged/index.jhtml") { vmn_page_data["metadata"]["section"] = "home"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; } } } } else if (path.lastIndexOf("/pictures/",0) === 0) { //photo page (thumnailis or photo) vmn_page_data["metadata"]["hub"] = "photos"; vmn_page_data["metadata"]["section"] = "photos"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; vmn_page_data["metadata"]["flipbook_id"] = pathparts[3]; vmn_page_data["mappings"]["key-values"]["fid"] = "@flipbook_id"; if (typeof document.seriesAlias !== 'undefined' || typeof document.seriesUrl !== 'undefined') { //show-related flipbook vmn_page_data["metadata"]["hub"] = "tv"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if (typeof document.seriesUrl !== 'undefined') { setSeriesValuesForUrl(document.seriesUrl); } else { vmn_page_data["metadata"]["seriesalias"] = document.seriesAlias.replace(/-/g,"_"); vmn_page_data["metadata"]["franchise"] = document.seriesAlias.replace(/-/g,"_"); } vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@seriesalias"; vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; } } else if (path.lastIndexOf("/videos/",0) === 0) { //video detail page (normal or full episode) vmn_page_data["metadata"]["section"] = "videos"; vmn_page_data["mappings"]["key-values"]["section"] = "@section"; vmn_page_data["mappings"]["exclusion-categories"] = "video_pages"; vmn_page_data["mappings"]["key-values"]["content_type"] = "@content_type"; if(path.indexOf("full-episode.jhtml", path.length - "full-episode.jhtml".length) !== -1) { //full episode player var isSeriesRelated=false; if (typeof MTVN.Player.tvSeriesObj !== "undefined" && typeof MTVN.Player.tvSeriesObj.url !== "undefined") { setSeriesValuesForUrl(MTVN.Player.tvSeriesObj.url); isSeriesRelated=true; } else if (typeof document.seriesUrl !== 'undefined' && document.seriesUrl !== "") { setSeriesValuesForUrl(document.seriesUrl); isSeriesRelated=true; } if (!isSeriesRelated) { vmn_page_data["metadata"]["seriesalias"] = document.seriesAlias; vmn_page_data["metadata"]["franchise"] = document.seriesAlias; } vmn_page_data["metadata"]["hub"] = "tv"; vmn_page_data["metadata"]["content_id"] = MTVN.Player.id; vmn_page_data["metadata"]["content_type"] = "full_eps"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["content_id"] = "@content_id"; vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@seriesalias"; vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; } else { //playlist or standard player if (typeof MTVN.Player.defaultPlaylistId !== 'undefined') { vmn_page_data["metadata"]["content_id"] = MTVN.Player.defaultPlaylistId; vmn_page_data["mappings"]["key-values"]["content_id"] = "@content_id"; } vmn_page_data["metadata"]["video_id"] = MTVN.Player.vid; vmn_page_data["mappings"]["key-values"]["video_id"] = "@video_id"; if((typeof document.seriesAlias !== 'undefined' && document.seriesAlias !== "") || MTVN.Player.contentTypeId == 4 || MTVN.Player.contentTypeId == 8 || MTVN.Player.contentTypeId == 25 || MTVN.Player.contentTypeId == 32 || MTVN.Player.contentTypeId == 33 || MTVN.Player.contentTypeId == 34 || MTVN.Player.contentTypeId == 35 || MTVN.Player.contentTypeId == 36 || MTVN.Player.contentTypeId == 45 ){ //show clip vmn_page_data["metadata"]["hub"] = "tv"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; vmn_page_data["metadata"]["content_type"] = "clips"; var isSeriesRelated=false; if (typeof MTVN.Player.tvSeriesObj !== "undefined" && typeof MTVN.Player.tvSeriesObj.url !== "undefined") { setSeriesValuesForUrl(MTVN.Player.tvSeriesObj.url); isSeriesRelated=true; } else if (typeof document.seriesUrl !== 'undefined' && document.seriesUrl !== "") { setSeriesValuesForUrl(document.seriesUrl); isSeriesRelated=true; } else if (typeof MTVN.Player.tvSeriesObj !== "undefined" && typeof MTVN.Player.tvSeriesObj.urlAlias !== "undefined") { vmn_page_data["metadata"]["seriesalias"] = MTVN.Player.tvSeriesObj.urlAlias.replace(/-/g,"_"); vmn_page_data["metadata"]["franchise"] = MTVN.Player.tvSeriesObj.urlAlias.replace(/-/g,"_"); isSeriesRelated=true; } else if (typeof document.seriesAlias !== 'undefined' && document.seriesAlias !== "") { vmn_page_data["metadata"]["seriesalias"] = document.seriesAlias.replace(/-/g,"_"); vmn_page_data["metadata"]["franchise"] = document.seriesAlias.replace(/-/g,"_"); isSeriesRelated=true; } if (isSeriesRelated) { vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@seriesalias"; vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; } } else { //we'll call everything else a music video vmn_page_data["metadata"]["hub"] = "music"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; vmn_page_data["metadata"]["content_type"] = "music_videos"; if (typeof document.azAlias !== 'undefined') { vmn_page_data["metadata"]["artist"] = document.azAlias; vmn_page_data["mappings"]["key-values"]["artist"] = "@artist"; } // and recognize some franchises if (pathparts[2]=="cmt-listen-up"){ vmn_page_data["metadata"]["franchise"] = "listen_up"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; } else if (pathparts[2]=="cmt-soundcheck-sessions"){ vmn_page_data["metadata"]["franchise"] = "sound_check"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; } else if (pathparts[2]=="concrete-country"){ vmn_page_data["metadata"]["franchise"] = "concrete_country"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; } else if (pathparts[2]=="live-at-cmt"){ vmn_page_data["metadata"]["franchise"] = "live_at_cmt"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; } else if (pathparts[2]=="unplugged"){ vmn_page_data["metadata"]["franchise"] = "unplugged"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; } } } } else if (path.lastIndexOf("/shows/",0) === 0 || path.lastIndexOf("/show/",0) === 0) { //shows/tv section vmn_page_data["metadata"]["hub"] = "tv"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; if (path == "/shows/" || path == "/shows/index.jhtml") { //main page vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["exclusion-categories"] = "hub_pages"; } else if ( path == "/shows/schedule/" || path == "/shows/schedule/index.jhtml") { //show schedule page vmn_page_data["metadata"]["franchise"] = "schedule"; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["section"] = "home"; } else { // show pages (either /shows/dyn/{alias}/... or /show/{alias}/... vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if (pathparts[2] == "dyn") { //legacy show page setSeriesValuesForUrl(path); if (pathparts[4] == "series.jhtml") { //main page //vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["key-values"]["section"] = "home"; } else if (pathparts[4] == "episode_list.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "episode_summary"; } else if (pathparts[4] == "series_characters.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "cast"; } vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@seriesalias"; } else { //platform show page setSeriesValuesForUrl(path); if (pathparts[3].lastIndexOf("season_",0) === 0) { //seasonal show if (pathparts[4] == "series.jhtml") { //main page //vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["key-values"]["section"] = "home"; } else if (pathparts[4] == "episodes.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "episode_summary"; } else if (pathparts[4] == "cast_characters.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "cast"; } } else { //non-seasonal show if (pathparts[3] == "series.jhtml") { //main page //vmn_page_data["metadata"]["is_main"] = true; vmn_page_data["mappings"]["key-values"]["section"] = "home"; } else if (pathparts[3] == "episodes.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "episode_summary"; } else if (pathparts[3] == "cast_characters.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "cast"; } } vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@seriesalias"; } } } else if (path.lastIndexOf("/dog-and-beth-on-the-hunt/",0) === 0) { //special show, Dog and Beth On the Hunt vmn_page_data["metadata"]["hub"] = "tv"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; vmn_page_data["metadata"]["franchise"] = pathparts[1]; vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; if (pathparts[2] == "episodes.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "episode_summary"; } else if (pathparts[2] == "cast.jhtml") { vmn_page_data["mappings"]["key-values"]["section"] = "cast"; } vmn_page_data["mappings"]["key-values"]["franchise"] = "@franchise"; vmn_page_data["mappings"]["key-values"]["seriesalias"] = "@franchise"; } else if (path.lastIndexOf("/acm-awards/",0) === 0) { //ACM Awards tentpole (default main here, individual pages set in pages) vmn_page_data["metadata"]["hub"] = "acm_awards"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; if ( path == "/acm-awards/" || path == "/acm-awards/index.jhtml") { vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["metadata"]["franchise"] = "home"; } } else if (path.lastIndexOf("/cma-awards/",0) === 0) { //CMA Awards tentpole (default main here, individual pages set in pages) vmn_page_data["metadata"]["hub"] = "cma_awards"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; if ( path == "/cma-awards/" || path == "/cma-awards/index.jhtml") { vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["metadata"]["franchise"] = "home"; } } else if (path.lastIndexOf("/cmt-music-awards/",0) === 0) { //CMT Music Awards tentpole (default main here, individual pages set in pages) vmn_page_data["metadata"]["hub"] = "cmt_awards"; vmn_page_data["mappings"]["ad-unit"]["2"] = "@hub"; //vmn_page_data["settings"]["reload"] = false; //cmt music awards does not refresh ads (old side effect of voting) if ( path == "/cmt-music-awards/" || path == "/cmt-music-awards/index.jhtml") { vmn_page_data["mappings"]["ad-unit"]["3"] = "@franchise"; vmn_page_data["metadata"]["franchise"] = "home"; } } else if (path.lastIndexOf("/one_country/",0) === 0) { // set sponsor value for all one country pages vmn_page_data["mappings"]["key-values"]["sponsor"] = "one_country"; }