Skip to content

Commit

Permalink
Merge branch 'release/4.0.1' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Sep 21, 2022
2 parents 972da13 + 986ea29 commit ed241c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Instant Analytics Changelog

## 4.0.1 - 2022.09.21
### Fixed
* Fixed an exception that could be thrown if IA's settings in the CP were not filled in ([#73](https://github.com/nystudio107/craft-instantanalytics/issues/73))

## 4.0.0 - 2022.09.16
### Added
* Initial Craft CMS 4 release
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-instantanalytics",
"description": "Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce",
"type": "craft-plugin",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [
"craft",
"cms",
Expand Down
45 changes: 23 additions & 22 deletions src/InstantAnalytics.php
Expand Up @@ -361,31 +361,32 @@ private function sendPageView(): void
if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest() && !self::$pageViewSent) {
self::$pageViewSent = true;
$analytics = self::$plugin->ia->getGlobals(self::$currentTemplate);

// Bail if we have no analytics object
if ($analytics === null) {
return;
}
// If SEOmatic is installed, set the page title from it
$this->setTitleFromSeomatic($analytics);
// Send the page view
if ($analytics) {
$response = $analytics->sendPageview();
Craft::info(
Craft::t(
'instant-analytics',
'pageView sent, response:: {response}',
[
'response' => print_r($response, true),
]
),
__METHOD__
);
} else {
Craft::error(
Craft::t(
'instant-analytics',
'Analytics not sent because googleAnalyticsTracking is not set'
),
__METHOD__
);
}
$response = $analytics->sendPageview();
Craft::info(
Craft::t(
'instant-analytics',
'pageView sent, response:: {response}',
[
'response' => print_r($response, true),
]
),
__METHOD__
);
} else {
Craft::error(
Craft::t(
'instant-analytics',
'Analytics not sent because googleAnalyticsTracking is not set'
),
__METHOD__
);
}
}

Expand Down

0 comments on commit ed241c5

Please sign in to comment.