Can we address this via a variable? You can use variables in HEREDOC:

```php
$script = '.google-analytics.com/ga.js';
if (true === $this->tracker->getEnableDisplayAdvertising()) {
    $script = 'stats.g.doubleclick.net/dc.js';
}

return <<<SCRIPT
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '$script';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();\n
  SCRIPT;
```