{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":47586,"path":"servicenow-platform/knowledge-management/configure-activity-context.md","title":"Configure activity contexts for Self-Service Analytics","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure activity contexts for Self-Service Analytics\n\nDefine the type of activities you want to collect as Self-Service Analytics data for a user entity such as consumers and customer contacts.\n\n## Before you begin\n\nRole required: sn\\_ssa\\_core.self\\_service\\_manager\n\n## About this task\n\nThe activity types you add to an activity context are already predefined for use in applications that use the Subscriptions and Activity Feed Framework. This framework is available when you install the Subscriptions and Activity Feed Framework plugin \\(com.snc.activity\\_subscriptions\\). The plugin is activated when you activate the Self-Service Analytics Core plugin \\(com.snc.self\\_service\\_analytics\\_core\\).\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Self-Service Analytics** &gt; **Configuration** &gt; **Activity Context**.\n\n2.  In the Activity Contexts list, search for and select the activity context for your user entity.\n\n    -   For consumers, select **Consumer**.\n    -   For customer contacts, select **Contact**.\n    -   For user entities other than consumers and customer contacts, click **New** to create another activity context.\n    **Note:** To get the activity contexts Consumer and Contact by default, you must install Self-Service Analytics for Customer Service \\(com.snc.pa.self\\_service\\_analytics\\_csm\\) plugin.\n\n3.  On the Activity Context form, verify the default field values for consumers and customer contacts, or fill in the values for a custom configuration.\n\n<table id=\"table_bxj_sbx_4jb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nUnique name for your activity context.\n\n</td></tr><tr><td>\n\nContext Table\n\n</td><td>\n\nTable that includes the user entity whose actions need to be tracked and displayed on the Self-Service Analytics dashboard.For example, if you want to track all actions for a customer contact, select the Contact \\[customer\\_contact\\] table. Similarly, if you want to track all actions for a consumer, select the Consumer \\[csm\\_consumer\\] table.​\n\n</td></tr><tr><td>\n\nModule\n\n</td><td>\n\nModule associated with the application that stores the activities data.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nScope of the application. This field is automatically set based on the application scope selected in the application picker.\n\n</td></tr><tr><td>\n\nDomain\n\n</td><td>\n\nDomain in which the activities records exist.\n\n</td></tr></tbody>\n</table>4.  If you are creating a new activity context, click **Submit** and then select the newly created activity context link from the Activity Contexts list.\n\n5.  In the Activity Context Groups related list, map an activity context with activity groups.\n\n    -   For consumers and customer contacts, verify the default field values for an existing configuration.\n    -   For user entities other than consumers and customer contacts, click **New** to create another activity group or map with an existing activity group.\n    For a new activity group mapping, on the Activity Group form, fill in the fields and click **Submit**. In the Activity Context Groups related list, you then have to select the newly created activity group and add available activity types to the activity group.\n\n    |Field|Description|\n    |-----|-----------|\n    |Activity Context|Activity context associated with the activity group.|\n    |Activity Group|Option to search for and select an activity group.|\n    |Application|Defines the scope of the application. This field is automatically populated based on the application scope.|\n    |Domain|Domain in which the activities records exist.|\n\n6.  In the Activity Context Types related list, map an activity context with an activity type.\n\n    -   For consumers and customer contacts, verify the default field values for an existing configuration.\n    -   For user entities other than consumers and customer contacts, click **New** to create another mapping or use an existing configuration.\n    For a new activity type mapping, on the Activity Source Context Mapping form, fill in the fields and click **Submit**.\n\n<table id=\"table_cvd_kkb_nlb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nActivity Context\n\n</td><td>\n\nActivity context associated with the activity source.\n\n</td></tr><tr><td>\n\nContext Table\n\n</td><td>\n\nTable that includes the user entity whose actions need to be tracked and displayed on the Self-Service Analytics dashboard.This field is auto-populated based on the selected activity context.\n\n</td></tr><tr><td>\n\nActivity Type\n\n</td><td>\n\nActivity type you want to associate with the activity context.\n\n</td></tr><tr><td>\n\nSource Table\n\n</td><td>\n\nTable from which the data for the activity context is populated.\n\n</td></tr><tr><td>\n\nFilter Criteria\n\n</td><td>\n\nFilter conditions applied on the source table.\n\n</td></tr><tr><td>\n\nAdvanced Mapping\n\n</td><td>\n\nOption to enable advanced mapping of activity source and activity context. You enter a script in the **Advanced Mapping Script** field.\n\n</td></tr><tr><td>\n\nAdvanced Mapping Script\n\n</td><td>\n\nScript to use if the source and context mapping is not sufficient. This field appears only when the **Advanced Mapping** option is selected.\n\n</td></tr><tr><td>\n\nModule\n\n</td><td>\n\nModule associated with the application that stores the activities data.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nScope of the application that contains the user entity. This field is automatically set based on the application scope selected in the application picker.\n\n</td></tr><tr><td>\n\nDomain\n\n</td><td>\n\nDomain in which the activities records exist.\n\n</td></tr><tr><td>\n\nFetch from Activities\n\n</td><td>\n\nOption to enable a business rule defined for an activity type.\n\n</td></tr></tbody>\n</table>7.  On the Activity Context form, click **Update**.\n\n\n## What to do next\n\n[Configure pattern elements for Self-Service Analytics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/knowledge-management/configure-pattern-element.md).\n\n**Parent Topic:**[Configure Self-Service Analytics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/knowledge-management/config-ssa.md)\n\n"}}