Skip to content

Commit

Permalink
fix: undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Jun 12, 2023
1 parent b7697b4 commit 7523bfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GoogleTagManagerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public static function getDataLayer()
{
// support nonce on scripts
$controller = Controller::curr();
$scriptTag = 'script';

if ($controller && $controller->hasMethod('getNonce')) {
$nonce = $controller->getNonce();
Expand All @@ -111,7 +112,8 @@ public static function getDataLayer()
$javascript = "<$scriptTag>dataLayer = [{";

// combine all the data layer values into a single data layer
$javascript .= implode(',',
$javascript .= implode(
',',
array_filter([
self::buildDataLayer()
])
Expand Down

0 comments on commit 7523bfe

Please sign in to comment.