/// Produces http encoded parameter string to send to the analytics
/// service.
Produces http encoded parameter string to send to the analytics
service.
Produces http encoded parameter string to send to the analytics service .
pub fn make_body_with_hash(
    app_name: &str,
    app_version: Option<&str>,
    ga_property_id: &str,
    category: Option<&str>,
    action: Option<&str>,
    labels: Option<&str>,
    custom_dimensions: BTreeMap<&str, String>,
    uuid: String,
) -> String {
    let uname = os_and_release_desc();
    let mut params = BTreeMap::new();
    params.insert(GA_PROTOCOL_KEY, GA_PROTOCOL_VAL);
    params.insert(GA_PROPERTY_KEY, ga_property_id);
    params.insert(GA_CLIENT_KEY, &uuid);
    params.insert(GA_DATA_TYPE_KEY, GA_DATA_TYPE_EVENT_KEY);
    params.insert(GA_APP_NAME_KEY, app_name);
    params.insert(
        GA_APP_VERSION_KEY,
        match app_version {
            Some(ver) => ver,
            None => GA_APP_VERSION_DEFAULT,
        },
    );
    params.insert(
        GA_EVENT_CATEGORY_KEY,
        match category {
            Some(value) => value,
            None => GA_EVENT_CATEGORY_DEFAULT,
        },
    );
    insert_if_present(GA_EVENT_ACTION_KEY, &mut params, action);
    insert_if_present(GA_EVENT_LABELS_KEY, &mut params, labels);
    for (&key, value) in custom_dimensions.iter() {
        params.insert(key, value);
    }
    params.insert(GA_CUSTOM_DIMENSION_1_KEY, &uname);
    let body = to_kv_post_body(&params);
    //println!("body = {}", &body);
    body
}
pub fn make_body_with_hash ( app_name : & str , app_version : Option < & str > , ga_property_id : & str , category : Option < & str > , action : Option < & str > , labels : Option < & str > , custom_dimensions : BTreeMap < & str , String > , uuid : String , ) -> String { let uname = os_and_release_desc ( ) ; let mut params = BTreeMap :: new ( ) ; params . insert ( GA_PROTOCOL_KEY , GA_PROTOCOL_VAL ) ; params . insert ( GA_PROPERTY_KEY , ga_property_id ) ; params . insert ( GA_CLIENT_KEY , & uuid ) ; params . insert ( GA_DATA_TYPE_KEY , GA_DATA_TYPE_EVENT_KEY ) ; params . insert ( GA_APP_NAME_KEY , app_name ) ; params . insert ( GA_APP_VERSION_KEY , match app_version { Some ( ver ) => ver , None => GA_APP_VERSION_DEFAULT , } , ) ; params . insert ( GA_EVENT_CATEGORY_KEY , match category { Some ( value ) => value , None => GA_EVENT_CATEGORY_DEFAULT , } , ) ; insert_if_present ( GA_EVENT_ACTION_KEY , & mut params , action ) ; insert_if_present ( GA_EVENT_LABELS_KEY , & mut params , labels ) ; for ( & key , value ) in custom_dimensions . iter ( ) { params . insert ( key , value ) ; } params . insert ( GA_CUSTOM_DIMENSION_1_KEY , & uname ) ; let body = to_kv_post_body ( & params ) ; //println!("body = {}", &body); body }
Produces http encoded parameter string to send to the analytics
service.
Produces http encoded parameter string to send to the analytics service .
app_name
&str
app_version
Option<&str>
ga_property_id
&str
category
Option<&str>
action
Option<&str>
labels
Option<&str>
custom_dimensions
BTreeMap<&str, String>
uuid
String