mbr_tag
Usage
This shortcode adds and/or removes specified tags, to/from either the logged in user contact record in ActiveCampaign, or to/from the contact specified.
The shortcode can be run automatically or used to generate a button or link within a page or post that, when clicked, will add or remove a specified tag to/from the contact record.
Parameters
Parameters | Description |
---|---|
cid | The ActiveCampaign contact ID of the contact to add tags or remove tags. Default: Current logged in user contact ID. Required: no. |
assign | One or more tag ID's or tag names defined within ActiveCampaign to add to the contact. The available tags can be found in ActiveMember360, Utilities, Tags. If more than one is entered, please separate with commas. Default: none. Required: Yes if remove parameter not set. |
remove | One or more tag ID's or tag names defined within ActiveCampaign to remove from the contact. The available tags can be found in ActiveMember360, Utilities, Tags. If more than one is entered, please separate with commas. Default: none. Required: Yes if assign parameter not set. |
autocreate_tags | If set to yes non-existent tags in your ActiveCampaign application specified for the assign_tags parameter will be automatically created. If the tag does not exist the value for assign_tags will be used as the tag name. Default: yes Required: no. |
autorun | If set to yes the shortcode will execute without waiting for user input. Otherwise it will generate a form and a submit button or link_style and wait for user input. If set to yes the following parameters will be ignored; link_text , link_style , button_text , button_image , button_style , redirect_popup , aftertext .Permissible Values: yes Default: none. Required: no. |
link_text | The text to display for the link. Default: Click here to submit Required: no. |
link_style | The CSS style to apply for the link. Default: mbr_tag_link Required: no. |
button_text | The text to display on the button. Default: Click here to submit Required: no. |
button_image | The URL of the image to use for the button. Default: none. Required: no. |
button_style | The CSS style to apply for the button. Default: none. Required: no. |
redirect | The URL to send the user to after assigning/removing the tags. A special value can be passed, #reload#, to force all shortcodes on the page to resolve based on the latest changes that may have been introduced by the tag changes. Default: none. Required: no. |
redirect_popup | Specifies whether the user will be redirected to a new window after clicking the link or button. Only used if the redirect parameter is set. Permissible Values: yes Default: none. Required: no. |
after_text | The text that should be displayed after the shortcode has been processed, if the user hasn’t been redirected. Default: Your request was processed Required: no. |
The use of tag ID's over tag names is encouraged. Unless a tag is deleted, its tag ID can be considered persistent and unique. Tag names, on the other hand, can be changed at any time and do not need to be unique. Using a tag name that is not unique or has been changed can cause your shortcode, hook or module to no longer work as expected.
Validity
This shortcode is only processed for logged in users who also exist as contacts within ActiveCampaign.
In all other cases, including WordPress users with the Administrator role nothing will be processed.
Conditional Branching
This shortcode does NOT support conditional branching with [ELSE_tag].
Nesting
Shortcode nesting is NOT supported.
Examples
- Example 1
- Example 2
- Example 3
- Example 4
Remove tags with IDs 123 and 45 from and then assign tags with IDs 55, 66, and 77 to the current logged users ActiveCampaign contact record after they click the button labelled 'Click here'. When processing has completed display 'Your request was processed':
[mbr_tag assign='55,66,77' remove='123,45' button_text='Click here']
Assign tags with IDs 12 and 34 to the current logged users ActiveCampaign contact record after they click the button labelled 'Click here'. After adding the tags force a page reload:
[mbr_tag assign='12,34' redirect='#reload#']
Remove tags with IDs 123 and 987 from, and then assign tags with IDs 12, 34, and 56 to the current logged users ActiveCampaign contact record. Process this automatically as soon as they visit the page. When processing has completed display 'Your request was processed':
[mbr_tag assign='12,34,56' remove='123,987' autorun='yes']
Assign tags with IDs 12 34 and 56 to the ActiveCampaign contact ID 1234 after the visitor clicks the button labelled 'Click here'. After adding the tags redirect to the URL https://mysite.com: :
[mbr_tag cid='1234' assign='12,34,56' redirect='https://mysite.com']
API
There is currently no ActiveMember360 API function equivalent for this shortcode.