File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,19 @@ public function enableRevenue( $settings ) {
36
36
return $ settings ;
37
37
}
38
38
39
+ /**
40
+ * Enable Enhanced Measurements > IE Compatibility
41
+ *
42
+ * @param $settings
43
+ *
44
+ * @return mixed
45
+ */
46
+ public function enableCompat ( $ settings ) {
47
+ $ settings [ 'enhanced_measurements ' ] = [ 'compat ' ];
48
+
49
+ return $ settings ;
50
+ }
51
+
39
52
/**
40
53
* Enable form completions by modifying the settings array.
41
54
*
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ public function testAddPlausibleAttributes() {
18
18
19
19
$ this ->assertStringContainsString ( 'example.org ' , $ tag );
20
20
$ this ->assertStringContainsString ( 'plausible.io/api/event ' , $ tag );
21
+ $ this ->assertStringContainsString ( 'plausible-analytics-js ' , $ tag );
22
+
23
+ add_filter ( 'plausible_analytics_settings ' , [ $ this , 'enableCompat ' ] );
24
+
25
+ $ class = new Filters ();
26
+ $ tag = $ class ->add_plausible_attributes ( '<script id="plausible-analytics-js" src="test.js"> ' , 'plausible-analytics ' );
27
+
28
+ remove_filter ( 'plausible_analytics_settings ' , [ $ this , 'enableCompat ' ] );
29
+
21
30
$ this ->assertStringNotContainsString ( 'plausible-analytics-js ' , $ tag );
22
31
}
23
32
}
You can’t perform that action at this time.
0 commit comments