tag management, add_tag_to_query function