Onboarding Tenant Account

After creating the tenant account in the Admin portal, on board the campaign ID of the client into database and update campaign ID changes across the services.

Onboard Tenant Account in DB

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

  1. In the database, update the following queries in sequence to on board the tenant account.
    Use vrm;
    set @campaign := <campaignId>;
    
  2. Set the vertical name, which can be banking or insurance.
    set @dmpVerticalId := (select Id from DMPCampaignVertical where Name='<VerticalName>');
    set @region:= "aps1";
    UPDATE `Campaign` SET IsDMP=1, IsRealtimeSeg=1, IsBfsi=1 WHERE Id=@campaign;
    #INSERT INTO `DMPCampaign` (CampaignId, DMPCampaignVerticalId,Region, UseVertica) VALUES (@campaign, @dmpVerticalId,@region, 0);
    Update DMPCampaign set Region = 'aps1' where CampaignId = @campaign;
    insert into `CampaignUnicodeRangeMapping` (CampaignId, UnicodeRanges) values (@campaign, 'U+0020-U+007F');
    
  3. 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.
    insert into `CampaignEncryptionKeyMapping` (CampaignId, keyId, TTL_Seconds, Keys_Count, IsActive) values (@campaign, '<KMS KEY ARN>', 86400, 100, 1);
    
  4. If needed, expose the segmentation parameters on UI as mentioned below.
    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

Create indexes on the collections used for segmentation and suggestion/count caching in 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.
    use segmentation;
    db.VIZVRM<CampaignId>.createIndex({"key":"hashed"},{"sparse":true});
    use cache;
    db.VIZVRM<CampaignId>_count.createIndex({"queryId":1},{"sparse":true,"unique":true});
    db.VIZVRM<CampaignId>_suggestion.createIndex({"queryId":1},{"sparse":true,"unique":true});

Add Campaign ID in Devtron

Update the dmp-sst and core-api apps with the Campaign ID in the Devtron.

  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 Mysql DB with data source configurations, follow the steps below:

  1. 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 using the following queries in sequence:
    Update DMPCampaignDataDictionary set Preference='pri' where Id = <crmAttributeId> and CampaignId = <CampaignId>;
    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;
    #<crmAttributeId>,<emailAttributeId> and <phoneAttributeId> are from DMPCampaignDataDictionary table.
    update DMPCampaignDataDictionary set IsRtsWhitelisted = 1 where Id = <crmAttributeId>;
  3. Create a DI API data source in 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');
    
  4. 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');

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