def set_tags(template: str, analysisname: str, era: str, sample_group: str) -> str:
    """
    Function used to set the tags in the template.

    Args:
        template: The template to be modified.
        analysisname: The name of the analysis.
        era: The era of the analysis.
        sample_group: The sample group of the analysis.

    Returns:
        The modified template.
    """
    return (
        template.replace("{ANALYSISTAG}", '"Analysis=%s"' % analysisname)
        .replace("{ERATAG}", '"Era=%s"' % era)
        .replace("{SAMPLETAG}", '"Samplegroup=%s"' % sample_group)
    )