File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ public function boot(): void
31
31
$ this ->bootForConsole ();
32
32
}
33
33
34
- // Only register the listener if the measurement_id and api_secret are set
35
- // to avoid unnecessary overhead.
36
- if (config ('ga4-event-tracking.measurement_id ' ) !== null
37
- && !config ('ga4-event-tracking.api_secret ' ) !== null
38
- ) {
39
- Event::listen (ShouldBroadcastToAnalytics::class, DispatchAnalyticsJob::class);
40
- }
34
+ $ this ->app ->booted (function () {
35
+ // Only register the listener if the measurement_id and api_secret are set
36
+ // to avoid unnecessary overhead.
37
+ if (config ('ga4-event-tracking.measurement_id ' ) !== null
38
+ && !config ('ga4-event-tracking.api_secret ' ) !== null
39
+ ) {
40
+ Event::listen (ShouldBroadcastToAnalytics::class, DispatchAnalyticsJob::class);
41
+ }
42
+ });
41
43
42
44
Blade::directive ('sendGA4ClientID ' , function () {
43
45
return "<?php echo view('ga4-event-tracking::sendClientID'); ?> " ;
You can’t perform that action at this time.
0 commit comments