Public Method Author API

setActivityTags()

Sets the Tags to be applied to the Activity being edited. This overwrites the current Tags for the Activity.

You would want to use this method so that you can programatically set the default Tags for sets of Activities, for example.

Important Any Tags that do not exist will be created when using this method. Ensure that all Tags are spelled and referenced correctly before calling this method.

Examples

var updatedTags = authorApp.setActivityTags(
    [
        { "type": "demo-tagtype-1", "name": "tag11" },
        { "type": "demo-tagtype-1", "name": "tag12" },
        { "type": "demo-tagtype-2", "name": "tag22" }
    ]
);
console.log(updatedTags);

Arguments

  • tags array[TagsV2]

    An array of TagsV2 objects.

Return value

  • array[TagsV2]

    Returns an array of TagsV2 objects that were successfully applied to the Activity.

  • boolean

    Returns false if unable to set the Activity Tags, for example, when not in the Activity editor view.

Caveats

The hide_tags intialization option has no effect on this method. Hidden tags will be returned by this method if they were specified in the arguments.

Type definitions

tagsV2 object

Tags are used to improve searching for content while authoring and for reporting and analytics purposes.

See Understanding Tag Formats for Content Creation and Filtering for more information.

  • name string

    The Tag name.

    Maximum length is 255 characters.

  • type string

    The Tag type.

    Maximum length is 255 characters.

Related articles

Was this article helpful?