Add tracking for enable auto renew links (#49710)

* Add tracking for enable auto renew link.

* Add UTM parameters to in-app enable auto-renew notice.

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Thilina Pituwala 2024-07-23 17:40:23 +02:00 committed by GitHub
parent ad7a49df4c
commit 158930ef4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Add tracking for enable auto renew links on notices

View File

@ -725,7 +725,7 @@ class PluginsHelper {
$hyperlink_url = add_query_arg(
array(
'utm_source' => 'pu',
'utm_campaign' => 'pu_settings_screen_renew',
'utm_campaign' => 'expired' === $type ? 'pu_settings_screen_renew' : 'pu_settings_screen_enable_autorenew',
),
self::WOO_SUBSCRIPTION_PAGE_URL
@ -769,7 +769,7 @@ class PluginsHelper {
'product_id' => $product_id,
'type' => $type,
'utm_source' => 'pu',
'utm_campaign' => 'pu_settings_screen_renew',
'utm_campaign' => 'expired' === $type ? 'pu_settings_screen_renew' : 'pu_settings_screen_enable_autorenew',
),
self::WOO_SUBSCRIPTION_PAGE_URL
@ -861,14 +861,20 @@ class PluginsHelper {
'expiring',
);
$button_link = self::WOO_SUBSCRIPTION_PAGE_URL;
$button_link = add_query_arg(
array(
'utm_source' => 'pu',
'utm_campaign' => 'pu_in_apps_screen_enable_autorenew',
),
self::WOO_SUBSCRIPTION_PAGE_URL
);
if ( in_array( $notice_data['type'], array( 'single_manage', 'multiple_manage' ), true ) ) {
$button_link = add_query_arg(
array(
'product_id' => $notice_data['product_id'],
'type' => 'expiring',
),
self::WOO_SUBSCRIPTION_PAGE_URL
$button_link
);
}