Search...
onTagCreated( )
An event that is triggered when a tag is created.
Description
The onTagCreated()
event handler runs when a tag is created. The received TagCreated
object contains information about the tag that was created.
Note: Backend events don't work when previewing your site.
Syntax
function wixBlog_onTagCreated(event: TagCreated): void
onTagCreated Parameters
NAME
TYPE
DESCRIPTION
event
Optional
TagCreated
Information about the tag that was created.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event that occurs when a tag is created
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixBlog_onTagCreated(event) {6 const tagId = event.metadata.entityId;7 const tagUrl = event.entity.url;8 console.log('Tag created', event);9}101112/*13 * {14 * "metadata":{15 * "id":"f48ae946-a320-4805-985a-28384e9487f3",16 * "entityId":"2d85ff8e-885e-47ad-a73a-ce9631c73a77",17 * "eventTime":"2022-06-16T15:16:20.376Z"18 * },19 * "entity":{20 * "_createdDate":"2022-06-16T15:16:20.347Z",21 * "_id":"2d85ff8e-885e-47ad-a73a-ce9631c73a77",22 * "_updatedDate":"2022-06-16T15:16:20.347Z",23 * "label":"new label",24 * "language":"en"25 * "postCount":0,26 * "publishedPostCount":0,27 * "slug":"new-update",28 * "url":"http://https://tadasz7.wixsite.com/blog-velo-events/my-blog/tags/new-label"29 * }30 * }31 */3233