Onboard Tenant Account

After creating a tenant account in the admin portal, backend onboarding is required to complete the setup process. This step ensures that the tenant is fully recognized by the system and properly integrated across all supporting services.

To enable full functionality, the tenant account must be registered in the application database. For clients with an associated campaign ID, this identifier must be inserted into the database and propagated across all dependent services. These tasks are typically performed by platform administrators or backend operations teams to ensure smooth and secure onboarding.

Onboard Tenant Account in DB

To onboard the campaign ID (tenant account), follow the steps below:

  1. In the database, update the following queries in sequence to onboard the tenant account. As a first step, select a vrm database.
    Use vrm;
  2. Set the Tenant ID /Campaign ID to the campaign variable. Make sure this tenant is created in the Admin UI.
    set @campaign := <campaignId>;
  3. Set the vertical name, which can be banking or insurance. This name is selected in the Admin UI while creating the Tenant account.
    set @dmpVerticalId := (select Id from DMPCampaignVertical where Name='<VerticalName>');
    UPDATE `Campaign` SET IsDMP=1, IsRealtimeSeg=1, IsBfsi=1 WHERE Id=@campaign;
  4. Set the AWS region of the tenant account in the region variable.
    set @region:= "aps1";
  5. Update the AWS region in the DMPCampaign table.
    Update DMPCampaign set Region = 'aps1' where CampaignId = @campaign;
    
  6. To support Unicode characters, @campaign is tenantid.
    insert into `CampaignUnicodeRangeMapping` (CampaignId, UnicodeRanges) values (@campaign, 'U+0020-U+007F');
  7. After updating the vertical name, generate a KMS key using the AWS console. Then, attach a key policy that allows the EC2 and Kubernetes service account IAM role to access the created KMS Key ID. Similarly, insert KMS key Id for Hashicorp(Openshift into CampaignEncryptionKeyMapping. This key ID will be used for PII (e.g. Mobile/Phone) Data Encryption.
    insert into `CampaignEncryptionKeyMapping` (CampaignId, keyId, TTL_Seconds, Keys_Count, IsActive) values (@campaign, '<KMS KEY ARN>', 86400, 100, 1);
  8. If needed, expose the segmentation parameters on UI as mentioned below. To enable the segmentation in fields like Country customer properties/attributes, add entries in FieldAliasTable table for attribute in profile, where adv_id is tenantid, original_field_name is data point code, modified_field_name is UI field name, type_of_ui_widget is data type of field like Text/Number, json_key is json path.
    INSERT Into FieldAliasTable ( adv_id,original_field_name,modified_field_name,type_of_ui_widget,is_new_user,json_key,index_of_group_key,suggest_at,CreatedOn,UpdatedOn,CreatedBy,UpdatedBy)
     VALUES ('@campaign','COUNTRY','COUNTRY','Text',0,'country',0,0,'2024-04-12',NULL,<user ID>,NULL), ('@campaign','CITY','CITY','Text',0,'city',0,0,'2024-04-20',NULL,<user ID>,NULL);

Create Index in MongoDB

After onboarding the tenant account in db, create indexes on the collections used for segmentation and suggestion/count caching in the MongoDB. To create indexes in MongoDB, follow the steps below:

  1. Log in to the primary node using mongosh, and execute the below queries in sequence. Switch the segmentation database.
    use segmentation;
  2. Create a hashed index for segmentation purposes.
    db.VIZVRM<CampaignId>.createIndex({"key":"hashed"},{"sparse":true});
  3. Now, switch cache database, and create an index on the queryId field for storing count or metrics data for that campaign.
    use cache;
    db.VIZVRM<CampaignId>_count.createIndex({"queryId":1},{"sparse":true,"unique":true});
  4. Create an index on the queryId field for storing suggestion related data.
    db.VIZVRM<CampaignId>_suggestion.createIndex({"queryId":1},{"sparse":true,"unique":true});

Add Campaign ID in Devtron

After onboarding the campaign ID into the database, the next step is to update the backend application services to ensure proper integration. Specifically, the campaign ID must be added to configuration properties in the dmp-sst and core-api applications.

To Add campaign ID in the Devtron, follow the steps below:

  1. Log into the Devtron app, in the configuration of dmp-sst app, set the campaign ID in the CampaignIncludeList Property, and deploy the app.
  2. Similarly, in the configuration of core-api app, set the campaign ID in the CampaignRegionList Property, and deploy the app.

Data Source Configurations

Configure the MySQL data sources with campaign details like campaign ID, email, mobile and so on.

To update the Mysql DB with the data source configurations, follow the steps below:

  1. Set the User Identifier for Upset charts, and insert the campaign details in the CDPCampaignUserIdentifier table using the following queries in sequence.
    insert into CDPCampaignUserIdentifier (CampaignId,Code,AlternateDescription) values (<CampaignId>,'vizid','Cookie');
    insert into CDPCampaignUserIdentifier (CampaignId,Code,AlternateDescription) values (<CampaignId>,'crmid','Customer_Id');
    insert into CDPCampaignUserIdentifier (CampaignId,Code,AlternateDescription) values (<CampaignId>,'he','Email');
    insert into CDPCampaignUserIdentifier (CampaignId,Code,AlternateDescription) values (<CampaignId>,'hm','Mobile');
    commit;
  2. Update the DMPCampaignDataDictionary table with Campaign ID details to set the primary identifier for the tenant:
    Update DMPCampaignDataDictionary set Preference='pri' where Id = <crmAttributeId> and CampaignId = <CampaignId>;
  3. Set the secondary identifier and priority of identifier for the tenant using the below queries. The <crmAttributeId>,<emailAttributeId> and <phoneAttributeId> are from DMPCampaignDataDictionary table.
    Update DMPCampaignDataDictionary set Preference='sec' where Id = <emailAttributeId> and CampaignId = <CampaignId>;
    Update DMPCampaignDataDictionary set Preference='sec',Priority=2 where Id = <phoneAttributeId> and CampaignId = <CampaignId>;
    commit;
    update DMPCampaignDataDictionary set IsRtsWhitelisted = 1 where Id = <crmAttributeId>;
  4. Create a Data Ingestion (DI) API data source in the MySQL database using the following queries in sequence.
    set @pss :=(select max(Id) from DMPCampaignDataSource)+1;
    INSERT INTO DMPCampaignDataSource (Id, CampaignId, Name, Format, IsActive, IsNba, IsTriggerDataSource, DisplayName) VALUES
    (@pss,<CampaignID>,'dataingestionapi','json',1, 1, 1, 'DIAPI');
    
  5. Similarly, create a pixel listener data source using the following queries in sequence.
    INSERT INTO DMPCampaignDataSource(CampaignId, Name, Format, IsActive, IsOnline, IsTriggerDataSource, DisplayName) 
    VALUES(<CampaignID>, 'analyze_post', 'json', 1, 1, 1, 'analyze_post');

Enable DI API Email and Phone Encryption

Enable Email and Phone Encryption in DI API:
  1. Go to the DI API handler directory, and navigate to: /MarketingAutomation/tree/release/DataIngestionAPIV2/js-server/handler.
  2. Switch to the correct branch to ensure you're on the release branch.
  3. Locate and open the file named <tenantid>.js.
  4. Add or update the logic to enable email and phone encryption according to your project's security requirements.
  5. Commit the updated file to the release branch with an appropriate commit message, and deploy the updated app so the changes take effect.

Create Pixel Listener Data Source

To create a Pixel Listener Data Source, follow the steps below:

  1. Connect to the database that hosts the DMPCampaignDataSource table.
  2. Run the following SQL command, replacing <CampaignID> with the actual tenant ID to insert the pixel listener data source:
    INSERT INTO DMPCampaignDataSource
    (CampaignId, Name, Format, IsActive, IsOnline, IsTriggerDataSource, DisplayName)
    VALUES(<CampaignID>, 'analyze_post', 'json', 1, 1, 1, 'analyze_post');

Refresh UI dashboard

After updating the data source, use the below url on any browser to refresh the UI dashboard,

https://<Domain>/populateCDPDashboardData/campaign/<CampaignId>

Sample url is provided below for reference.

https://<rts-ms domain>/populateCDPDashboardData/campaign/6525