Generated URL
if(empty(prop("URL")) or empty(prop("Medium")) or empty(prop("Source")) or empty(prop("Campaign Name")), "⚠️ You must enter the Medium, Source, and Campaign Name", prop("URL") + "?utm_medium=" + prop("Medium") + "&utm_source=" + prop("Source") + "&utm_campaign=" + replaceAll(prop("Campaign Name"), " ", "%20") + if(empty(prop("Content")), "", "&utm_content=" + replaceAll(prop("Content"), " ", "%20")) + if(empty(prop("Keyword")), "", "&utm_term=" + replaceAll(prop("Keyword"), " ", "%20")))
Explanation
if(empty(prop("URL")) or empty(prop("Medium")) or empty(prop("Source")) or empty(prop("Campaign Name")), "⚠️ You must enter the Medium, Source, and Campaign Name",
If URL, Medium, Source, or Campaign Name are empty, display ⚠️ You must enter the Medium, Source, and Campaign Name
prop("URL") + "?utm_medium=" + prop("Medium") + "&utm_source=" + prop("Source") + "&utm_campaign=" + replaceAll(prop("Campaign Name"), " ", "%20") + "&utm_content=" + replaceAll(prop("Content"), " ", "%20") + "&utm_term=" + replaceAll(prop("Keyword"), " ", "%20"))
Otherwise concatenate those properties with their
utm_[property]=
values.replaceAll(prop("[Property Name]"), " ", "%20")
This will simply replace all the spaces in the corresponding values with
%20