src/TagPlanet/UniversalAnalytics/UniversalAnalytics.php
public function render($renderedCodeBlock = true, $renderScriptTag = true)
    {
        // Setup our return array
        $js = array();
        
        // Do we need to add script tags?
        if($renderScriptTag)
            $js[] = '<script>';
            
        foreach($this->instances as $instance)
        {
            // Since we could have multiple trackers, we'll want to grab each render
            $js[] = $instance->render($renderedCodeBlock, false) . PHP_EOL;
            
            // Make sure we only render the UA code block once
            $renderedCodeBlock = false;
        }
        
        // Do we need to add script tags?
        if($renderScriptTag)
            $js[] = '</script>';
        
        // Return our combined render
        return implode(PHP_EOL, $js);
    }
public function render($renderedCodeBlock = true, $renderScriptTag = true)
    {
        // Setup our return array
        $js = array();
        
        // Do we need to add script tags?
        if($renderScriptTag)
            $js[] = '<script>';
            
        foreach($this->instances as $instance)
        {
            // Since we could have multiple trackers, we'll want to grab each render
            $js[] = $instance->render($renderedCodeBlock, false) . PHP_EOL;
            
            // Make sure we only render the UA code block once
            $renderedCodeBlock = false;
        }
        
        // Do we need to add script tags?
        if($renderScriptTag)
            $js[] = '</script>';
        
        // Return our combined render
        return implode(PHP_EOL, $js);
    }
public function render ( $ renderedCodeBlock = true , $ renderScriptTag = true ) { // Setup our return array $ js = array ( ) ; // Do we need to add script tags? if ( $ renderScriptTag ) $ js [ ] = '<script>' ; foreach ( $ this -> instances as $ instance ) { // Since we could have multiple trackers, we'll want to grab each render $ js [ ] = $ instance -> render ( $ renderedCodeBlock , false ) . PHP_EOL ; // Make sure we only render the UA code block once $ renderedCodeBlock = false ; } // Do we need to add script tags? if ( $ renderScriptTag ) $ js [ ] = '</script>' ; // Return our combined render return implode ( PHP_EOL , $ js ) ; }
Render the Universal Analytics code

@return string
Render the Universal Analytics code