Gets a specific Activity that occurred on the current site.
SDK Version: SDK 1.28.0+
Components: Dashboard
Syntax:
Parameters:
Name | Type | Description |
---|---|---|
id (required) | String | The ID of the activity to look up |
onSuccess (required) | Function | Callback function to receive an object with data about the activity |
onFailure (required) | Function | Callback triggered if the data could not be returned successfully |
Example:
This method posts an activity to the current site. When the Activity is successfully created, the id of the activity will be returned. If schema validation fails, or other errors occur, an error is returned.
SDK Version: SDK 1.25.0 – 1.77.0+
Display: Live Site
Components: Widget, Pinned (aka Fixed-Position) Widget, Page, Modal, Popup
Syntax:
Parameters:
Name | Type | Description |
---|---|---|
**activity (required) | Object | An activity descriptor (must follow specific type/schema pattern) |
activity.type (required) | Wix.Activities.Type | The activity type as detailed in the table below |
activity.info (required) | Object | Detailed information about this activity, according to the activity type schema |
activity.details (required) | Object | More information about the activity |
activity.details.additionalInfoUrl (required) | String | The URL to open when the user clicks on the activity notification in the site’s dashboard. Apps with a dashboard component: link to this specific activity within your app’s Dashboard component:HTTP://www.wix.com/my-account/app/<appID>/<appInstanceID>/<appState>. For example, if a site visitor makes a purchase, direct users to a page where they can see details about this purchase. Apps without a dashboard component: Enter “null” or direct the user to a page with information about this activity. For example, if a site visitor liked a photo, direct the user to this photo on the live site. |
activity.contactUpdate (required) | Object | Information about the site visitor who performed this activity. If you have any information about the site visitor, use contactUpdate to link the activity to a site Contact. Make sure to include at least the email or phone number in your request - we need it to create/update the contact. If not, use 'null'. However, note that we won't display the activity in the site's dashboard until we can link the activity to a contact. |
activity.contactUpdate.name | Object | Contact's name |
activity.contactUpdate.name.prefix | String | Name prefix (limited to 100 characters) |
activity.contactUpdate.name.first | String | First name (limited to 100 characters) |
activity.contactUpdate.name.middle | String | Middle name (limited to 100 characters) |
activity.contactUpdate.name.last | String | Last name (limited to 100 characters) |
activity.contactUpdate.name.suffix | String | Name suffix (limited to 100 characters |
activity.contactUpdate.picture | String | URL to the contact's photo |
activity.contactUpdate.company | Object | Contact's company details |
activity.contactUpdate.company.role | String | Contact's role at the company (limited to 100 characters) |
activity.contactUpdate.company.name | String | Contact's company name (limited to 100 characters) |
activity.contactUpdate.emails | Array[object] | Contact's emails |
activity.contactUpdate.emails.id | Number | ID of this email within the array |
activity.contactUpdate.emails.tag (required) | String | Tag for this email - home, work, etc. (limited to 100 characters) |
activity.contactUpdate.emails.email (required) | String | Contact's email address (limited to 250 characters) |
activity.contactUpdate.emails.emailStatus | "optOut", "transactional", or "recurring" | The subscription status for this email. optOut: Contact unsubscribed from all emails. transactional: Contact subscribed to non-promotional emails. recurring: Contact subscribed to all emails. |
activity.contactUpdate.emails.deliveryStatus | ‘valid’, ‘spam’, ‘complaint’, ‘rejected’, ‘deferral’, ‘bounce’ | Email delivery status. valid: When emails are delivered successfully. spam: When emails are marked as spam by the recipient. complaint: When the recipient of the email has made a complaint to the email provider. rejected: When the email is rejected by email provider. deferral: When your email provider refuses to send emails. bounce: When the mailbox is full, email address doesn't exist, etc. |
activity.contactUpdate.phones | Array[object] | Contact's phone |
activity.contactUpdate.phones.Id | Number | ID of this phone number within the array |
activity.contactUpdate.phones.tag (required) | String | Tag for this phone number - home, work, etc (limited to 100 characters) |
activity.contactUpdate.phones.phone (required) | String | Contact's phone number (limited to 30 characters) |
activity.contactUpdate.phones.normalizedPhone | String | Contact's normalized phone number |
activity.contactUpdate.addresses | Array[object] | Contact's address |
activity.contactUpdate.addresses.id | Number | ID of this address within the array |
activity.contactUpdate.addresses.tag (required) | String | Tag for this address - home, work, etc (limited to 100 characters) |
activity.contactUpdate.addresses.address | String | Contact's street address (limited to 250 characters) |
activity.contactUpdate.addresses.neighborhood | String | Contact's neighborhood (limited to 100 characters) |
activity.contactUpdate.addresses.city | String | Contact's city (limited to 100 characters) |
activity.contactUpdate.addresses.region | String | Contact's region, such as a U.S. state or Canadian province (limited to 100 characters) |
activity.contactUpdate.addresses.country | String | Contact's country (limited to 100 characters) |
activity.contactUpdate.addresses.postalCode | String | Contact's postal code (limited to 20 characters) |
activity.contactUpdate.urls | Array[object] | URLs associated with the contact, like Facebook or LinkedIn |
activity.contactUpdate.urls.id | Number | ID of this URL within the array |
activity.contactUpdate.urls.tag (required) | String | Tag for this URL - personal, work, etc (limited to 100 characters) |
activity.contactUpdate.urls.url (required) | String | The URL |
activity.contactUpdate.dates | Array[object] | Important dates for this contact, like birthday |
activity.contactUpdate.dates.id | Number | ID of this date within the array |
activity.contactUpdate.dates.tag (required) | String | Tag for this date - birthday, anniversary, etc (limited to 100 characters) |
activity.contactUpdate.dates.date (required) | String | The date, as an ISO 8601 timestamp |
onSuccess (required) | Function | Success callback function |
onFailure | Function | Failure callback function |
The activity types that you can currently post:
Type | Activity | Description |
---|---|---|
FORM_CONTACT_FORM | form/contact-form | When your app submits a contact form |
FORM_SUBSCRIPTION_FORM | form/subscription-form | When your app submits a subscription form |
FORM_FORM | form/form | When your app submits another type of form |
SCHEDULER_APPOINTMENT | scheduler/appointment | When an appointment is made |
SCHEDULER_CONFIRMATION | scheduler/confirmation | When an appointment is confirmed. Availability: Since 1.45.0 |
SCHEDULER_CANCEL | scheduler/cancel | When an appointment is cancelled. Availability: Since 1.45.0 |
SOCIAL_COMMENT | social/comment | When a site visitor posts a comment on the site. Availability: Since 1.61.0 |
SOCIAL_SHARE_URL | social/share-url | When a site visitor shares an item (like a blog post or photo) on social media. Availability: Since 1.61.0 |
SOCIAL_TRACK | social/track | When a site visitor takes one of these social media actions on the user’s channel: like, follow, subscribe, pin. Availability: Since 1.61.0 |
HOTELS_PURCHASE | hotels/purchase | When a hotel service is purchased |
HOTELS_PURCHASE_FAILED | hotels/purchase-failed | When a purchase (of the hotel service) could not be completed |
HOTELS_RESERVATION | hotels/reservation | When a reservation is made |
HOTELS_CONFIRMATION | hotels/confirmation | When a reservation is confirmed |
HOTELS_CANCEL | hotel/cancel | When a reservation is cancelled |
TRACK_PLAY | music/track-play | When a request to start playing a song is made |
TRACK_SKIP | music/track-skip | When a track was skipped |
TRACK_PLAYED | music/track-played | When a song finished playing |
TRACK_LYRICS | music/track-lyrics | When the track lyrics are requested |
TRACK_SHARE | music/track-share | When a track is shared using your app |
ALBUM_SHARE | music/album-share | When an album is shared using your app |
ALBUM_FAN | music/album-fan | When a visitor becomes a fan of an album |
ALBUM_PLAYED | music/album-played | When an album finished playing |
ECOMMERCE_CART_ADD | ecommerce/cart-add | When an item is added to a cart. Availability: Since 1.45.0 |
ECOMMERCE_CART_REMOVE | ecommerce/cart-remove | When an item is removed from a cart. Availability: Since 1.45.0 |
ECOMMERCE_CART_CHECKOUT | ecommerce/cart-checkout | When a checkout process has begun with this cart. Availability: Since 1.45.0 |
ECOMMERCE_CART_ABANDON | ecommerce/cart-abandon | When a cart is abandoned. Availability: Since 1.45.0 |
ECOMMERCE_PURCHASE | ecommerce/purchase | When the checkout process has completed |
MESSAGE_IM | messaging/im | When a chat/sms message is sent between a Wix user and a site visitor/contact |
EVENTS_RSVP | events/rsvp | When a guest RSVPs to an event. Availability: Since 1.77.0 |
RESTAURANTS_ORDER | restaurants/order | When an order is placed in a restaurant. Availability: Since 1.77.0. |
Example: