Skip to content

Commit 6982fc0

Browse files
authored
PLANET-7951: Adjust the value for the utm_campaign parameter (#2813)
- Pass the value of Local Project in lowercase and transform empty spaces into hyphens.
1 parent 6493827 commit 6982fc0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Context.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ public static function set_utm_params(array &$context, object $post): void
8888
}
8989

9090
/**
91-
* Parse the utm_campaign param. It's not needed to add if the value is equal to `not set`.
91+
* Parse the utm_campaign param.
92+
* Pass the value in lowercase and transform empty spaces into hyphens.
93+
* It's not needed to add if the value is equal to `not set`.
9294
*
9395
* @param string $cf_local_project It comes from meta p4_global_project_tracking_id value.
9496
*/
9597
public static function parse_utm_campaign_param(string $cf_local_project): string
9698
{
9799
if ('not set' !== $cf_local_project) {
98-
return '&utm_campaign=' . $cf_local_project;
100+
return '&utm_campaign=' . strtolower(str_replace(' ', '-', $cf_local_project));
99101
}
100102
return '';
101103
}

0 commit comments

Comments
 (0)