Skip to content

Commit a901c6e

Browse files
committed
Added: Search queries can now be enabled for Growth plans.
1 parent 1140b07 commit a901c6e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Admin/Provisioning.php

+6
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,13 @@ public function maybe_create_custom_properties( $old_settings, $settings ) {
360360
* Create Custom Properties for Search Queries option.
361361
*/
362362
if ( Helpers::is_enhanced_measurement_enabled( 'search', $enhanced_measurements ) ) {
363+
$caps = get_option( 'plausible_analytics_api_token_caps', [] );
364+
363365
foreach ( $this->custom_search_properties as $property ) {
366+
if ( empty( $caps[ 'props' ] ) && $property === 'result_count' ) {
367+
continue;
368+
}
369+
364370
$properties[] = new Client\Model\CustomProp( [ 'custom_prop' => [ 'key' => $property ] ] );
365371
}
366372
}

src/Admin/Settings/Page.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function __construct() {
173173
'slug' => 'enhanced_measurements',
174174
'type' => 'checkbox',
175175
'value' => 'search',
176-
'caps' => [ self::CAP_GOALS, self::CAP_PROPS ],
176+
'caps' => [ self::CAP_GOALS ],
177177
],
178178
'tagged-events' => [
179179
'label' => esc_html__( 'Custom events', 'plausible-analytics' ),

0 commit comments

Comments
 (0)