def process_domain_assoc(url, domain_map):
    """
    Replace domain name with a more fitting tag for that domain.
    User defined. Mapping comes from provided config file

    Mapping in yml file is as follows:
    tag:
        - url to map to tag
        - ...

    A small example domain_assoc.yml is included
    """
    if not domain_map:
        return url

    for key in domain_map:
        if url in domain_map[key]:
            return key

    return url