app/Module/GoogleAnalyticsModule.php
public function analyticsSnippet(array $parameters): string
    {
        // Add extra dimensions (i.e. filtering categories)
        $tree = app(Tree::class);
        $user = app(UserInterface::class);

        $parameters['dimensions'] = (object) [
            'dimension1' => $tree instanceof Tree ? $tree->name() : '-',
            'dimension2' => $tree instanceof Tree ? Auth::accessLevel($tree, $user) : '-',
        ];

        return view('modules/google-analytics/snippet', $parameters);
    }
public function analyticsSnippet(array $parameters): string
    {
        // Add extra dimensions (i.e. filtering categories)
        $tree = app(Tree::class);
        $user = app(UserInterface::class);

        $parameters['dimensions'] = (object) [
            'dimension1' => $tree instanceof Tree ? $tree->name() : '-',
            'dimension2' => $tree instanceof Tree ? Auth::accessLevel($tree, $user) : '-',
        ];

        return view('modules/google-analytics/snippet', $parameters);
    }
public function analyticsSnippet ( array $ parameters ) : string { // Add extra dimensions (i.e. filtering categories) $ tree = app ( Tree :: class ) ; $ user = app ( UserInterface :: class ) ; $ parameters [ 'dimensions' ] = ( object ) [ 'dimension1' => $ tree instanceof Tree ? $ tree -> name ( ) : '-' , 'dimension2' => $ tree instanceof Tree ? Auth :: accessLevel ( $ tree , $ user ) : '-' , ] ; return view ( 'modules/google-analytics/snippet' , $ parameters ) ; }
Embed placeholders in the snippet.

@param string[] $parameters

@return string
Embed placeholders in the snippet .