‘Mr. Gorbachev, Tear Down This Wall’

Join Patriots for Trump 2020 !

Saturday marks the 30th anniversary of the fall of the Berlin Wall, and perhaps no other person, and certainly no other American president, had more to do with its demise than President Ronald Reagan.

The Berlin Wall — built starting in 1961 — divided the communist, Soviet-controlled sector of East Berlin from the democratic, free Western sector of the city.

The government of East Germany constructed the divide to stem the flow of millions of its citizens to the West that had occurred over the previous decade-and-a-half following the end of World War II.

By agreement of the Allied powers at the end of the war, the eastern third of Germany fell in the Soviet sphere of control, while the western two-thirds was occupied by the Americans, the British and the French.

TRENDING: Soros’ $800k Attempt To Buy Election Backfires When GOP Candidate Nets Even Larger Win Than Expected

In a speech before the Brandenburg Gate on the West Berlin side in June 1987, Reagan famously said to Mikhail Gorbachev, the leader of Soviet Union, “General Secretary Gorbachev, if you seek peace — if you seek prosperity for the Soviet Union and Eastern Europe — if you seek liberalization: Come here to this gate.

“Mr. Gorbachev, open this gate. Mr. Gorbachev, tear down this wall!”

Surprisingly, one of Reagan’s most renown and consequential lines almost did not make it into his Berlin remarks, according to speechwriter Peter Robinson, who drafted the address.

Robinson recounts in his book “How Ronald Reagan Changed My Life” that a number of top officials in the State Department and the National Security Council, including no less than Secretary of State George Schultz and Deputy National Security Adviser Colin Powell, wanted the line out: too provocative.

Robinson wrote that the phrase was inspired by Ingeborg Elz, a German woman living in West Berlin who, along with her husband, had hosted the Reagan staffer when he traveled to Berlin weeks in advance of the president’s visit.

“If this man Gorbachev is serious with his talk of glasnost and perestroika,” she said, “he can prove it. He can get rid of this wall.”

Glasnost was a Gorbachev policy of promoting more openness on the part of the Soviet government, while perestroika was intended to move the communist country more toward capitalism.

The idea of calling for the wall to come down stuck with Robinson, and Reagan liked it too after he read Robinson’s draft of the speech.

The commander in chief overrode the persistent opposition to its inclusion.

“Whether it was the NSC, the State Department or others, there was every effort made to try to prevent President Reagan from acting so bold and to state what he did, but it shows that’s an example of true leadership,” John Heubusch, executive director of the Ronald Reagan Presidential Foundation, told The Western Journal.

RELATED: Ronald Reagan Presidential Library Survives Ravenous Wildfire with Help from Goats

The foundation oversees the Ronald Reagan Presidential Library in Simi Valley, California.

In June 1987, as Reagan was on his way to deliver his Berlin speech, his deputy chief of staff, Ken Duberstein, recalled the president saying, “The boys at State are going to kill me, but it’s the right thing to do.”

Reagan’s words had a profound impact.

Ulrike Marschinke, who was living in East Berlin when the president delivered his remarks, recalled years later what a bold declaration it was.

“When I heard Mr. Reagan say, ‘Mr. Gorbachev, tear down this wall,’ I thought to myself, ‘What a strange idea!’” Marschinke said. “I only knew the world with the wall. In the East, the Communist Party, in the West, the rest of the world. I couldn’t imagine how it would work to live without the wall. It was impossible for me to understand what would happen.”

Robinson and Heubusch both see Reagan’s speech as part of a continuum of the Republican leader speaking out against the evils of communism.

One of his best-known addresses on the subject came five years before Berlin in June 1982 remarks to the British Parliament.

“What I am describing now is a plan and a hope for the long term — the march of freedom and democracy which will leave Marxism-Leninism on the ash-heap of history as it has left other tyrannies which stifle the freedom and muzzle the self-expression of the people,” he said.

The Gipper followed that prophecy with another less than a year later while speaking to the annual convention of the National Association of Evangelicals in Orlando, Florida.

“Yes, let us pray for the salvation of all of those who live in that totalitarian darkness — pray they will discover the joy of knowing God,” Reagan said.

“But until they do, let us be aware that while they preach the supremacy of the state, declare its omnipotence over individual man, and predict its eventual domination of all peoples on the Earth, they are the focus of evil in the modern world,” he continued.

Reagan then asserted that “communism is another sad, bizarre chapter in human history whose last pages even now are being written.”

Heubusch told The Western Journal that Reagan’s “evil empire” speech gave people living in the eastern European countries controlled by the Soviets — such as Poland, Hungary, Romania and Czechoslovakia — a vision for a new day ahead.

The address “gave people on the wrong side of the wall tremendous hope that President Reagan and the United States would do all that it could to bring an end to communism, and it did,” Heubusch said.

Reagan’s son Michael told The Western Journal this summer one of the main reasons his father sought the presidency was to confront Soviet communism.

“He said for too long he had watched American presidents sit down with secretary generals of the Soviet Union, and every time they sat down, the Soviet Union asked the American president give up something to get along with them,” Micheal Reagan said.

He recalled his father said, “I wanted to be the first president elected to sit down with the secretary general of the Soviet Union and while he was telling me what I was going to have to give up to get along with him, I was going to get up from my chair, walk around the other side of the table, lean over and whisper in his ear, ‘Nyet.’”

Reagan backed up his words with the largest peacetime military buildup in U.S. history, which included the modernization of armaments across the armed services and the deployment of intermediate nuclear missiles in Europe to counter the Soviet threat.

Heubusch notes there were multiple forces in play helping bring about the fall of the Berlin Wall, including actions taken by the Soviet leader.

“You can’t discount Mikhail Gorbachev’s role in the whole glasnost movement, essentially an opening of the door to different thinking and revolutionary change that really prepared central and eastern Europe to eventually allow the wall to fall,” he said.

Heubusch also pointed to prominent European leaders at the time who took bold stands, including British Prime Minister Margaret Thatcher and West German Chancellor Helmut Kohl.

Pope John Paul II, a native of Poland, was a consistent and powerful voice against the evils of communism.

Then, of course, there were the East Germans themselves who started staging massive demonstrations at the wall, including on the night of Nov. 9, 1989, when their government finally relented, allowing them to freely cross into the West.

Then-ABC News correspondent Sam Donaldson caught up with Reagan as the wall was coming down and asked if he thought the moment would come so soon, Fox News anchor Bret Baier records in his book “Three Days in Moscow.”

Reagan, who had left office earlier that year, confessed he did not.

“Well, I didn’t know when it would come, but I’ll tell you, as an eternal optimist I believe in my heart it was in the future,” he said.

Donaldson — a frequent critic of the 40th president — referenced Reagan’s “ash-heap of history” speech and asked whether he felt vindicated.

Do you think Reagan helped bring about the end of the Cold War?

The Californian did not take the opportunity to boast, but simply replied, “The people have seen that communism had its chance, and it does not work.”

Eleven months after the fall of the wall, in October 1990, Germany reunified as a free, democratic country.

I was able to visit Berlin in June 2018, 30 years after traveling to the divided city as a West Point cadet.

It was a heartwarming sight to see the wall down, the city united and the Checkpoint Charlie building (which I went through to visit East Berlin in 1988) removed to a museum.

Randy DeSoto visiting Berlin in June 2018, left, and June 1988.

Asked what lesson Reagan’s actions during the Cold War teach, Heubusch answered, “Always do the right thing.”

“There is no accommodating forces or civilizations or cultures that believe that the destiny of man is one that should be controlled by the state, and Reagan knew that, so he stuck with his guns,” the Reagan Foundation director said.

Heubusch pointed out that Reagan himself was not willing to embrace the moniker of the “Great Communicator” that many sought to place on him, rather saying he just “communicated great things,” which he said did not originate with him but came from the “heart of a great nation” and the principles that had guided it for over two centuries.

“Fortunately, Ronald Reagan had a vision and set of core values that he lived by, and we’re now seeing the results of it today, 30 years later,” he said.

Western Journal publisher Floyd Brown, who worked on Reagan’s 198o campaign and in his administration, said the former president had a particular set of gifts that helped bring about the fall of the wall and the end of the Cold War.

“It was a combination of being firm and strong while also extending the hand of friendship. It takes an extremely unique personality to be able to do both those things,” he told The Western Journal.

Heubusch observed that Reagan’s impact can be seen in the statues and avenues named for him, particularly throughout Europe, “from London to Prague to Tbilisi to Budapest to Warsaw.”

Michael Reagan said, “It doesn’t matter where I go in the world, or where his family goes in the world, you’re respected and you’re loved and you’re appreciated, because of what he accomplished.”

Heubusch planned to be in Berlin on Friday when Secretary of State Mike Pompeo unveils a statue of Reagan at the U.S. embassy there.

The statue will sit on a terrace overlooking the spot near the Brandenburg Gate where the American leader’s words rang out: “Mr. Gorbachev, tear down this wall!”

We are committed to truth and accuracy in all of our journalism. Read our editorial standards.

","rendering_script":"(function() {rnvar referer="";try{if(referer=document.referrer,"undefined"==typeof referer||""==referer)throw"undefined"}catch(exception){referer=document.location.href,(""==referer||"undefined"==typeof referer)&&(referer=document.URL)}referer=referer.substr(0,700);rnvar rcds = document.getElementById("rcjsload_503882");rnvar rcel = document.createElement("script");rnrcel.id = 'rc_' + Math.floor(Math.random() * 1000);rnrcel.type = 'text/javascript';rnrcel.src = "https://trends.revcontent.com/serve.js.php?w=110580&t="+rcel.id+"&c="+(new Date()).getTime()+"&width="+(window.outerWidth || document.documentElement.clientWidth)+"&referer="+encodeURIComponent(referer);rnrcel.async = true;rnrcds.appendChild(rcel);rn})();"}]},"BA1":{"ad_type":"custom","custom_ads":[{"code":"

rn

","rendering_script":"let fbs = document.createElement( 'script' );rnfbs.src = 'https://connect.facebook.net/en_US/fbadnw60-tag.js';rnfbs.async = 'async';rndocument.head.appendChild( fbs );rnwindow.ADNW = window.ADNW || {};rnwindow.ADNW.v60 = window.ADNW.v60 || {};rnwindow.ADNW.v60.slots = window.ADNW.v60.slots || [];rnwindow.ADNW.v60.slots.push({rntrootElement: document.getElementById( 'fb_ba1' ),rntplacementid: window.innerWidth > 943 ? '1521975967886043_2493230114093952' : '1521975967886043_2262514003832232',rntformat: 'recirculation',rnttestmode: false,rntonAdLoaded: function(rootElement) {rnttconsole.log('Audience Network [ba1] ad loaded');rnttrootElement.style.display = 'block';rnt},rntonAdError: function(errorCode, errorMessage) {rnttconsole.log('Audience Network [ba1] error (' + errorCode + ') ' + errorMessage);rnt}rn});rnrnlet rcs = document.createElement( 'script' );rnrcs.src = "http://www.westernjournal.com///assets.revcontent.com/master/delivery.js";rndocument.body.appendChild( rcs );"}]},"BB1":{"ad_type":"dfp_prebid"},"IC4":{"ad_type":"dfp_prebid","lazy_load":"yes","size_mappings":[{"screen_width":"944"},{"screen_width":"468","creative_sizes":[{"size":"468x60"},{"size":"336x280"},{"size":"300x250"}]},{"screen_width":"1","creative_sizes":[{"size":"300x250"},{"size":"320x100"},{"size":"320x50"}]}],"bidders":[{"name":"appnexus","device_category":"mobile","appnexus_placementid":"13210086","audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":null,"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"ix","device_category":"all","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":"193609","ix_size":[{"size":"300"},{"size":"250"}],"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"ix","device_category":"all","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":"193609","ix_size":[{"size":"336"},{"size":"280"}],"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"ix","device_category":"all","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":"193609","ix_size":[{"size":"468"},{"size":"60"}],"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"ix","device_category":"mobile","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":"193609","ix_size":[{"size":"320"},{"size":"100"}],"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"ix","device_category":"mobile","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":"193609","ix_size":[{"size":"320"},{"size":"50"}],"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"pubmatic","device_category":"all","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":null,"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":"158410","pubmatic_adslot":"ic4_wj","rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null}],"repeating":true},"SB5":{"ad_type":null},"WP1":{"ad_type":"dfp_prebid","size_mappings":[{"screen_width":"1","creative_sizes":[{"size":"1x1"}]}]},"SA1":{"ad_type":"dfp_prebid","size_mappings":[{"screen_width":"944"},{"screen_width":"350","creative_sizes":[{"size":"320x100"},{"size":"320x50"},{"size":"1x1"}]}],"bidders":[{"name":"appnexus","device_category":"mobile","appnexus_placementid":"14827619","audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":null,"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"pubmatic","device_category":"all","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":null,"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":"158410","pubmatic_adslot":"sa1_wj","rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":null,"underdogmedia_siteid":null},{"name":"triplelift","device_category":"mobile","appnexus_placementid":null,"audiencenetwork_placementid":null,"audiencenetwork_format":null,"ix_siteid":null,"justpremium_zone":null,"onedisplay_placement":null,"onedisplay_network":null,"onedisplay_bidfloor":null,"pubmatic_publisherid":null,"pubmatic_adslot":null,"rubicon_accountid":null,"rubicon_siteid":null,"rubicon_zoneid":null,"sovrn_tagid":null,"triplelift_inventorycode":"WesternJournal_SA1_mobile_320x50_hdx","underdogmedia_siteid":null}]}},"ad_type":"dfp_prebid","use_fixed_containers":"yes","lazy_load":"yes","scaling_sheet_id":"0","use_sx_units":"yes","replace_ict":"document.querySelector( '.article-extras.trending' ).outerHTML = '

'; (function (d,s,n,id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.className = n; js.src = "https://stream.playbuzz.com/embed/sdk.js?embedId=8c8cbe52-80e8-468f-a95b-ce8f1f39546b"; fjs.parentNode.insertBefore(js, fjs); }(document,'script','playbuzz-stream','stream-sdk-jssdk_westernjournal.com_RSS'));","cat":"uncategorized"};

FFADS.debug = function( msg ) { if( document.location.href.search( 'ffads_debug=true' ) !== -1 ) { if( typeof msg !== 'undefined' ) console.log( JSON.parse( JSON.stringify( msg ) ) ); else console.log( 'undefined' ); } }

FFADS.content_order = ["SA1","WP1","BB1","Top","IC1","IC2","IC3","IC4","BA1"]; FFADS.sidebar_order = ["SB1","SB2","SB3","SB4","SB5"];

for( let ad_unit in FFADS.units ) if( ( FFADS.units[ad_unit].ad_type == 'dfp_prebid' || FFADS.units[ad_unit].ad_type == 'hybrid' ) && FFADS.units[ad_unit].size_mappings ) for( let i = 0; i < FFADS.units[ad_unit].size_mappings.length; i++ ) if( window.innerWidth >= FFADS.units[ad_unit].size_mappings[i].screen_width ) { if( FFADS.units[ad_unit].size_mappings[i].creative_sizes && FF_EXCLUDE_ADS.indexOf( ad_unit ) == -1 ) FFADS.units[ad_unit].sizes = FFADS.units[ad_unit].size_mappings[i].creative_sizes.map( function( sizeObj ) { return sizeObj.size.split( 'x' ).map( function( numString ) { return parseInt( numString ); } ); } ); break; }

let new_unit_obj = {}; for( let i in FFADS.content_order ) { FFADS.debug( 'Checking if ' + FFADS.content_order[i] + ' is valid on this page' ); let ad_unit = FFADS.content_order[i].split( '_' )[0]; if( FFADS.units[ad_unit] && ( FFADS.units[ad_unit].ad_type == 'custom' || FFADS.units[ad_unit].sizes ) ) new_unit_obj[ad_unit] = FFADS.units[ad_unit]; else { FFADS.debug( FFADS.content_order[i] + ' is not valid on this page. Removing it from content_order.' ); FFADS.content_order[i] = false; } } FFADS.content_order = FFADS.content_order.filter( function( ad_unit ) { return ad_unit && FFADS.units[ad_unit.split( '_' )[0]].lazy_load; } ); if( window.innerWidth >= 944 ) for( let i in FFADS.sidebar_order ) { FFADS.debug( 'Checking if ' + FFADS.sidebar_order[i] + ' is valid on this page' ); if( FFADS.units[FFADS.sidebar_order[i]].ad_type == 'custom' || FFADS.units[FFADS.sidebar_order[i]].sizes ) new_unit_obj[FFADS.sidebar_order[i]] = FFADS.units[FFADS.sidebar_order[i]]; else { FFADS.debug( FFADS.sidebar_order[i] + ' is not valid on this page. Removing it from sidebar_order.' ); FFADS.sidebar_order[i] = false; } } FFADS.sidebar_order = FFADS.sidebar_order.filter( function( ad_unit ) { return ad_unit && FFADS.units[ad_unit].lazy_load; } ); FFADS.units = new_unit_obj;

FFADS.all_bidders = {"adyoulike":{"nicename":"Adyoulike","params":["placement"]},"appnexus":{"nicename":"AppNexus","params":["placementId"]},"audienceNetwork":{"nicename":"Audience Network","params":["placementId","format"]},"ix":{"nicename":"Index Exchange","params":["siteId"],"array_params":["size"]},"justpremium":{"nicename":"JustPremium","params":["zone"],"array_params":["allow","exclude"]},"onedisplay":{"nicename":"Oath","params":["placement","network","bidFloor"]},"pubmatic":{"nicename":"PubMatic","params":["publisherId","adSlot"]},"rubicon":{"nicename":"Rubicon","params":["accountId","siteId","zoneId"]},"sovrn":{"nicename":"Sovrn","params":["tagid"]},"triplelift":{"nicename":"TripleLift","params":["inventoryCode"]},"underdogmedia":{"nicename":"Underdog Media","params":["siteId"]}};

FFADS.pb_units = []; for( let bidder in FFADS.all_bidders ) { FFADS.all_bidders[bidder].param_map = {}; for( let param in FFADS.all_bidders[bidder].params ) FFADS.all_bidders[bidder].param_map[FFADS.all_bidders[bidder].params[param].toLowerCase()] = FFADS.all_bidders[bidder].params[param]; for( let param in FFADS.all_bidders[bidder].array_params ) FFADS.all_bidders[bidder].param_map[FFADS.all_bidders[bidder].array_params[param].toLowerCase()] = FFADS.all_bidders[bidder].array_params[param]; } for( let ad_unit in FFADS.units ) { FFADS.debug( ad_unit + ' type: ' + FFADS.units[ad_unit].ad_type ); FFADS.debug( ad_unit + ' size mappings:' ); FFADS.debug( FFADS.units[ad_unit].size_mappings ); if( ( FFADS.units[ad_unit].ad_type == 'dfp_prebid' || FFADS.units[ad_unit].ad_type == 'hybrid' ) && FFADS.units[ad_unit].size_mappings ) { FFADS.debug( 'creating PB unit(s) for ' + ad_unit ); let bids = []; for( let i in FFADS.units[ad_unit].bidders ) if( FFADS.units[ad_unit].bidders[i].device_category == 'all' || FFADS.units[ad_unit].bidders[i].device_category == 'desktop' && window.innerWidth >= 944 || FFADS.units[ad_unit].bidders[i].device_category == 'mobile' && window.innerWidth < 944 ) { let params = {}; for( let param in FFADS.units[ad_unit].bidders[i] ) if( param.search( FFADS.units[ad_unit].bidders[i].name.toLowerCase() + '_' ) === 0 ) { let param_name_lower = param.split( '_' ).splice( 1 ).join( '_' ); let param_name = FFADS.all_bidders[FFADS.units[ad_unit].bidders[i].name].param_map[param_name_lower]; if( typeof FFADS.units[ad_unit].bidders[i][param] == 'object' ) { params[param_name] = []; for( let j in FFADS.units[ad_unit].bidders[i][param] ) params[param_name].push( parseInt( FFADS.units[ad_unit].bidders[i][param][j][param_name_lower] ) || FFADS.units[ad_unit].bidders[i][param][j][param_name_lower] ); } else params[param_name] = FFADS.units[ad_unit].bidders[i][param]; } bids.push( { bidder: FFADS.units[ad_unit].bidders[i].name, params: params } ); } if( FFADS.units[ad_unit].repeating ) for( let i = 0; i < FF_REP_COUNT; i++ ) FFADS.pb_units.push( { sizes: FFADS.units[ad_unit].sizes, bids: bids, code: 'REP_' + i } ); else if( FFADS.units[ad_unit].rep_count ) for( let i = 0; i < FFADS.units[ad_unit].rep_count; i++ ) FFADS.pb_units.push( { sizes: FFADS.units[ad_unit].sizes, bids: bids, code: ad_unit + '_' + i } ); else FFADS.pb_units.push( { sizes: FFADS.units[ad_unit].sizes, bids: bids, code: ad_unit } ); } FFADS.units[ad_unit].instances = {}; if( FFADS.units[ad_unit].repeating ) for( let i = 0; i < FF_REP_COUNT; i++ ) FFADS.units[ad_unit].instances['REP_' + i] = {}; else if( FFADS.units[ad_unit].rep_count ) for( let i = 0; i < FFADS.units[ad_unit].rep_count; i++ ) FFADS.units[ad_unit].instances[ad_unit + '_' + i] = {}; else FFADS.units[ad_unit].instances[ad_unit] = {}; } FFADS.prebid_timeout = window.innerWidth > 943 ? FFADS.desktop_bidding_timeout : FFADS.mobile_bidding_timeout;

FFADS.get_unit_path = function( ad_unit ) { return '/' + ( this.dfp_account_id || 101957818 ) + '/' + ad_unit + '_' + ( this.custom_unit_code || 'WJ' ) + ( typeof this.use_sx_units != 'undefined' && this.use_sx_units == 'yes' ? ( window.innerWidth > 943 ? '_LGSX' : '_SMSX' ) : '' ); } FFADS.pbjs_bids_back = function() { FFADS.debug( 'PB bids back for initial units' ); FFADS.pbjs_ready = true; if( FFADS.a9_ready ) return sendInitialAdserverRequest(); } FFADS.render_ad = function( ad_unit, div_id = false ) { div_id = div_id || ad_unit; this.debug( 'refreshing ' + ad_unit + ' into #' + div_id ); this.units[ad_unit].instances[div_id].displayed = true; if( this.units[ad_unit].ad_type == 'custom' ) eval( this.units[ad_unit].custom_ads[0].rendering_script ); else googletag.cmd.push( this.request_bids.bind( this, ad_unit, div_id ) ); } FFADS.request_bids = function( ad_unit, div_id = false ) { div_id = div_id || ad_unit;

this.debug( 'requesting bids for ' + ad_unit + ' in #' + div_id );

FFADS.units[ad_unit].instances[div_id].gt_slot = googletag.defineSlot( this.get_unit_path( ad_unit ), this.units[ad_unit].sizes, div_id ).addService( googletag.pubads() ); window['firefly_pbjs_ready' + div_id] = false, window['firefly_a9_ready' + div_id] = false;

pbjs.requestBids( { bidsBackHandler: firefly_pbjs_bids_back_single.bind( null, ad_unit, div_id ), adUnitCodes: [div_id] } );

setTimeout( sendSingleAdserverRequest.bind( FFADS, ad_unit, div_id ), FFADS.prebid_timeout );

apstag.fetchBids( { slots: [ { slotID: div_id, slotName: this.get_unit_path( ad_unit ), sizes: this.units[ad_unit].sizes } ] }, firefly_a9_bids_back_single.bind( null, ad_unit, div_id ) ); };

FFADS.lazy_load_check = function() { FFADS.debug( 'checking lazy load' );

let wnhc_j = jQuery( '#wj-network-header-container' + ( window.innerWidth < 944 ? ', .jw-above-container.stuck:not( .never-stick ) .jw-sticky-container' : '' ) ).last(); let wnhc = wnhc_j.length ? wnhc_j.offset().top + wnhc_j.outerHeight() : 0; FFADS.debug( 'WNHC bottom is ' + wnhc ); let slide_units = document.querySelectorAll( '.sponsor > div.fixed-size.sliding > div' ); for( let i = 0; i < slide_units.length; i++ ) { FFADS.debug( 'checking margin for' ); FFADS.debug( slide_units[i] ); if( ! slide_units[i].firstElementChild ) break; this_unit_j = jQuery( slide_units[i] ); let max_margin = slide_units[i].parentElement.offsetHeight - slide_units[i].firstElementChild.offsetHeight; FFADS.debug( 'max margin is ' + max_margin ); let distance = wnhc - this_unit_j.parent().offset().top; if( distance > max_margin ) { slide_units[i].style.position = 'static'; slide_units[i].style.paddingTop = max_margin + 'px'; } else if( distance < 0 ) { slide_units[i].style.position = 'static'; slide_units[i].style.paddingTop = '0px'; } else if( slide_units[i].style.position != 'fixed' ) { slide_units[i].style.left = jQuery( slide_units[i].firstChild ).offset().left + 'px'; slide_units[i].style.position = 'fixed'; slide_units[i].style.paddingTop = '0px'; slide_units[i].style.top = jQuery( '#wpadminbar' ).outerHeight() + jQuery( '#wj-network-header-container' ).outerHeight() + ( window.innerWidth < 944 ? jQuery( '.jw-above-container.stuck:not( .never-stick ) .jw-sticky-container' ).outerHeight() : 0 ) + 'px'; } } for( let i = 0; i < FFADS.content_order.length; i++ ) { let ad_unit_id = FFADS.content_order[i]; let ad_unit = ad_unit_id.split( '_' )[0]; if( ! FFADS.units[ad_unit].repeating ) { if( checkAlmostVisible( document.getElementById( ad_unit_id ), FFADS.lazy_load_threshold ) ) { FFADS.debug( ad_unit_id + ' is almost visible' ); FFADS.content_order.splice( i, 1 ); // splice first in case render_ad fails FFADS.render_ad( ad_unit, ad_unit_id ); } else break; } else for( var j = 0; j < FF_REP_COUNT; j++ ) { let div_id = 'REP_' + j; if( ! FFADS.units[ad_unit].instances[div_id].displayed ) { if( checkAlmostVisible( document.getElementById( div_id ), FFADS.lazy_load_threshold ) ) { FFADS.debug( div_id + ' is almost visible' ); if( j == FF_REP_COUNT - 1 ) FFADS.content_order.splice( i, 1 ); // splice first in case render_ad fails FFADS.render_ad( ad_unit, div_id ); } else break; } } } if( typeof ffsid != 'undefined' && ! FFADS.spot_im_displayed && checkAlmostVisible( document.getElementById( 'respond' ), FFADS.lazy_load_threshold ) ) { var ffrespond = document.getElementById( 'respond' ); var simscript1 = document.createElement( 'script' ); var simscript2 = document.createElement( 'script' ); simscript1.async = simscript2.async = 'async'; simscript1.type = simscript2.type = 'text/javascript'; simscript1.src = 'https://recirculation.spot.im/spot/' + ffsid; simscript2.src = 'https://launcher.spot.im/spot/' + ffsid; simscript2.dataset.spotimModule = 'spotim-launcher'; simscript2.dataset.postUrl = simscript2.dataset.facebookUrl = ffsurl; simscript2.dataset.postId = ffspid; ffrespond.appendChild( simscript1 ); ffrespond.appendChild( simscript2 ); FFADS.spot_im_displayed = true; } if( window.innerWidth > 943 ) for( let i = 0; i < FFADS.sidebar_order.length; i++ ) { let ad_unit_code = FFADS.sidebar_order[i]; if( checkAlmostVisible( document.getElementById( ad_unit_code ), FFADS.lazy_load_threshold ) ) { FFADS.debug( ad_unit_code + ' is almost visible' ); FFADS.sidebar_order.splice( i, 1 ); FFADS.render_ad( ad_unit_code ); } else break; } } var pbjs = pbjs || {}; pbjs.que = pbjs.que || [ function() { FFADS.debug( 'pbjs.que starting' ); } ]; pbjs.bidderSettings = { standard: { bidCpmAdjustment: function( bidCpm, bid ) { let screen_size = window.innerWidth < 944 ? 'SMSX' : 'LGSX'; let factor = 1.0; if( typeof FFADS.units[bid.adUnitCode].scales[screen_size][bid.bidderCode] != 'undefined' ){ factor -= FFADS.units[bid.adUnitCode].scales[screen_size][bid.bidderCode]; FFADS.debug( 'factor for ' + bid.bidderCode + ' in ' + bid.adUnitCode + ' set to ' + factor + '; bid changed from ' + bidCpm + ' to ' + ( bidCpm *= factor ) ); } return bidCpm; } } }; pbjs.que.push(function() { pbjs.enableAnalytics( { provider: 'roxot', options: { publisherIds: ["556182c7-ac68-4d56-8c66-4b4336e28e5e"] } } ); pbjs.setConfig( { priceGranularity: "high", userSync: { iframeEnabled: true, filterSettings: { iframe: { bidders: ['openx', 'pubmatic'], filter: 'include' } } } } ); FFADS.debug( 'adding units to PB' ); FFADS.debug( FFADS.pb_units ); pbjs.addAdUnits( FFADS.pb_units ); let adUnitCodes = []; for( let ad_unit in FFADS.units ) if( ! FFADS.units[ad_unit].lazy_load ) adUnitCodes.push( ad_unit ); FFADS.debug( 'requesting PB bids for initial units' ); pbjs.requestBids({ bidsBackHandler: FFADS.pbjs_bids_back, adUnitCodes: adUnitCodes }); }); function sendInitialAdserverRequest() { if( FFADS.initialAdserverRequestSent ) return; FFADS.initialAdserverRequestSent = true; FFADS.debug( 'queuing DFP request for initial units' ); googletag.cmd.push(function() { pbjs.que.push(function() { FFADS.debug( 'sending DFP request for initial units' ); let adUnitCodes = []; let dfpAdUnits = []; for( let ad_unit in FFADS.units ) if( ! FFADS.units[ad_unit].lazy_load ) { if( FFADS.units[ad_unit].ad_type == 'hybrid' ) { let pb_bid = pbjs.getHighestCpmBids( ad_unit ); pb_bid = pb_bid.length ? pb_bid[0].cpm : 0; FFADS.debug( 'Prebid bid ' + pb_bid + ' for ' + ad_unit ); if( pb_bid < FFADS.units[ad_unit].custom_ads[0].cpm ) { FFADS.debug( 'Custom code won for ' + ad_unit ); let el = false; if( el = document.getElementById( ad_unit ) ) { el.innerHTML = FFADS.units[ad_unit].custom_ads[0].code; eval( FFADS.units[ad_unit].custom_ads[0].rendering_script ); } else FFADS.debug( 'failed to render custom code in ' + ad_unit + ' since the unit is not on this page' ); continue; } } adUnitCodes.push( ad_unit ); dfpAdUnits.push( FFADS.units[ad_unit].instances[ad_unit].gt_slot ); } pbjs.setTargetingForGPTAsync( adUnitCodes ); apstag.setDisplayBids(); googletag.pubads().refresh( dfpAdUnits ); }); }); } FFADS.debug( 'scheduling DFP request for initial units' ); setTimeout( function() { sendInitialAdserverRequest(); }, FFADS.prebid_timeout ); (function () { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); var googletag = googletag || {}; googletag.cmd = googletag.cmd || [ function() { FFADS.debug( 'googletag.cmd starting' ); } ]; googletag.cmd.push( function() { googletag.pubads().disableInitialLoad(); for( let ad_unit in FFADS.units ) if( ! FFADS.units[ad_unit].lazy_load && ( FFADS.units[ad_unit].ad_type == 'dfp_prebid' || FFADS.units[ad_unit].ad_type == 'hybrid' ) ) { FFADS.debug( 'defining slot for ' + ad_unit + ' #' + ad_unit ); FFADS.units[ad_unit].instances[ad_unit].gt_slot = googletag.defineSlot( FFADS.get_unit_path( ad_unit ), FFADS.units[ad_unit].sizes, ad_unit ).addService( googletag.pubads() ); } googletag.pubads().enableSingleRequest(); firefly_setTargeting(); googletag.pubads().setCentering(true); googletag.enableServices(); } ); function sendSingleAdserverRequest( ad_unit, div_id = false ) { div_id = div_id || ad_unit; if( FFADS.units[ad_unit].instances[div_id].adserverRequestSent ) return; FFADS.units[ad_unit].instances[div_id].adserverRequestSent = true; if( FFADS.units[ad_unit].ad_type == 'hybrid' ) { let pb_bid = pbjs.getHighestCpmBids( div_id ); pb_bid = pb_bid.length ? pb_bid[0].cpm : 0; FFADS.debug( 'Prebid bid ' + pb_bid + ' for #' + div_id ); if( pb_bid < FFADS.units[ad_unit].custom_ads[0].cpm ) { FFADS.debug( 'Custom code won for #' + div_id ); document.getElementById( div_id ).innerHTML = FFADS.units[ad_unit].custom_ads[0].code; eval( FFADS.units[ad_unit].custom_ads[0].rendering_script ); return; } } apstag.setDisplayBids(); pbjs.setTargetingForGPTAsync( [div_id] ); FFADS.debug( 'sending DFP request for ' + ad_unit + ' #' + div_id ); googletag.pubads().refresh( [FFADS.units[ad_unit].instances[div_id].gt_slot] ); } function firefly_pbjs_bids_back_single( ad_unit, div_id = false ) { div_id = div_id || ad_unit; FFADS.debug( 'PB bids back for ' + ad_unit + ' #' + div_id ); window['firefly_pbjs_ready' + ad_unit] = true; if( window['firefly_a9_ready' + ad_unit] ) return sendSingleAdserverRequest( ad_unit, div_id ); } function firefly_a9_bids_back_single( ad_unit, div_id = false ) { div_id = div_id || ad_unit; FFADS.debug( 'A9 bids back for ' + ad_unit + ' #' + div_id ); window['firefly_a9_ready' + ad_unit] = true; if( window['firefly_pbjs_ready' + ad_unit] ) return sendSingleAdserverRequest( ad_unit, div_id ); } !function(a9,a,p,s,t,A,g){if(a[a9])return;function q(c,r){a[a9]._Q.push([c,r])}a[a9]={init:function(){q("i",arguments)},fetchBids:function(){q("f",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},_Q:[]};A=p.createElement(s);A.async=!0;A.src=t;g=p.getElementsByTagName(s)[0];g.parentNode.insertBefore(A,g)}("apstag",window,document,"script","//c.amazon-adsystem.com/aax2/apstag.js"); apstag.init({ pubID: 'da224ee9-07c8-4a80-87e4-528df4ac939e', adServer: 'googletag', bidTimeout: FFADS.prebid_timeout }); var a9_slot_arr = []; for( var ad_unit in FFADS.units ) { if( ! FFADS.units[ad_unit].lazy_load ) var a9_slot_arr = a9_slot_arr.concat( [ { slotID: ad_unit, slotName: FFADS.get_unit_path( ad_unit ), sizes: FFADS.units[ad_unit].sizes } ] ); }; FFADS.debug( 'requesting A9 bids for initial units' ); apstag.fetchBids( { slots: a9_slot_arr }, function( bids ) { FFADS.debug( 'A9 bids back for initial units' ); FFADS.a9_ready = true; if( FFADS.pbjs_ready ) return sendInitialAdserverRequest(); } );

Loading...

Leave a Reply

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