def METHOD_NAME(file_path, file_content, compiled_regex, target_directory, repo_id):
    existing_matches = compiled_regex.search(file_content)
    if existing_matches:
        return compiled_regex.sub(get_tracking_pixel(TRACKING_PIXEL_MD_FORMAT_STRING, file_path, target_directory, repo_id), file_content)
    else:
        return file_content + '\n\n' + get_tracking_pixel(TRACKING_PIXEL_MD_FORMAT_STRING, file_path, target_directory, repo_id) + '\n'