@library.global_function
def add_utm(url_, campaign, source='developer.mozilla.org', medium='email'):
 url_obj = URLObject(url_).add_query_params({'utm_campaign': campaign, 'utm_source': source, 'utm_medium': medium})
 return str(url_obj)

@ library . global_function def add_utm ( url_ , campaign , source = 'developer.mozilla.org' , medium = 'email' ) : url_obj = URLObject ( url_ ) . add_query_params ( { 'utm_campaign' : campaign , 'utm_source' : source , 'utm_medium' : medium } ) return str ( url_obj )
add the utm_* tracking parameters to a url .