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 ) {
3636 return $ settings ;
3737 }
3838
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+
3952 /**
4053 * Enable form completions by modifying the settings array.
4154 *
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ public function testAddPlausibleAttributes() {
1818
1919 $ this ->assertStringContainsString ( 'example.org ' , $ tag );
2020 $ 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+
2130 $ this ->assertStringNotContainsString ( 'plausible-analytics-js ' , $ tag );
2231 }
2332}
You can’t perform that action at this time.
0 commit comments