--- title: "Campaign Prototype: How to make a system campaign enabled" slug: "campaign-prototype-how-to-make-a-system-campaign-enabled" updated: 2024-05-08T13:08:26Z published: 2024-05-08T13:08:26Z canonical: "docs.datajet.app/campaign-prototype-how-to-make-a-system-campaign-enabled" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # Campaign Prototype: How to make a system campaign enabled **Article in Progress...** PrototypeThe functionality described is in the prototype stage and **will** change - production systems should not use this functionality without provision for regular system upgrades, downtime and changes to configuration and functionality.  Any objects or data created with this prototype will be lost with future releases. ## Overview To set up a system to use the prototype campaign functionality: 1. Create required directories: 1. a **campaign root path directory** that is *accessible by all realms* that require access to campaign functionality  (e.g., "**/data_local/****campaignRootPath**") 2. **sourcepath** - this is the folder containing the raw data folders to be processed 1. **targetpath** - this is where the maindatafile.dat file will be stored 2. **segspath** - this is where the processed segment files will be stored 3. Set up the **djclient.cnfg** file to point to *campaignRootPath* for each realm that will access the campaign system 4. For each project that will be campaign enabled: 1. Create a **campaign definition file** in the campaignRootPath/realm directory for each project in the realm that will be campaign enabled. 2. Create a **campaign metadata file** in the campaignRootPath/realm directory for each project in the realm that will be campaign enabled. ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1715173699069.png) ## Required Directories/Locations - sourcepath - targetpath - segspath - campaignRootPath #### sourcepath #### targetpath #### segspath #### campaignRootPath The campaign root directory contains a sub directory for each realm that has had a **campaignRootPath** defined in it's djclient.cnfg file. A typical campaignRootPath would look as follows: "**/Home/DataSources/campaignRoot**" The client configuration file (djclient.cnfg) for any **realm** that accesses the campaign (or Eyeota) data must have the **campaignRootPath** entry: ```json "campaignRootPath": "D:/Datajet/campaignRootPath" ``` Automatic Directory CreationWhenever a connection is made to a campaign enabled realm, a directory for that realm will be automatically created in the campaignRootPath.   Sub directories will be created for any loaded projects on that realm. ## Campaign Project Files ### Campaign Project Definition File Campaign Definition Files are stored in the campaign root realm folder (e.g., in **d:/datajet/campaignRoot/dj-local**) A definition file is required in each realm **for each project** that is campaign enabled, and requires the name: *project.campaign.json* So a project called "**campaign_demo**" on the realm "dj-dev" would have: - A directory created at ".../**campaignRoot/dj-dev/campaign_demo**" - A file called called **campaign_demo.campaign.json** needs to be uploaded to  .../campaignRoot/dj-dev  (**.../campaignRoot/dj-dev/campaign_demo.campaign.json**) #### Campaign Definition File Contents | Key | Value | Description | | --- | --- | --- | | key | "tablename.fieldname" | tablename.fieldname of object that stores the dynamic integer key (auto generated from hash keys as part of load process) *NOTE: This must match the **key** field definition used in CreateTableFromFile when loading the hash-key file. e.g., entities.key* | | export{} | "fields":["field1", "field2"] "root": "rootExportPath" | fields: list of fields to include in an export root: the root folder for all exports *NOTE: One of these fields must match the HASH field definition used in CreateTableFromFile when loading the hash-key file. e.g., entities.hash* | | alternatePath | "path" | Optional. If segments are not stored as sub-directories of campaignRootPath, indicates the location where segment files are stored. | | variables[] | | RESERVED for future use | | subFolders | true/false | If true, **raw** segment data in stored in sub-folders (e.g., daily folders) | #### Sample Definition files ```json { "key": "entities.key", "export": { "fields": [ "entities.hash" ], "root": "D:/Datajet/campaignExports/" } } ``` ```json { "key": "DATA_EYEOTA.key", "subFolders": true, "alternatePath": "D:\\Datajet\\DataSources\\Examples\\EYEOTA\\segs\\", "variables": [ ], "export": { "fields": [ "DATA_EYEOTA.hash" ], "root": "D:/Datajet/campaignExports/" } } ``` ### Campaign Project Metadata File {} ### Client Configuration File {TODO: Link to djclient.cnfg page} "campaignRootPath": "home/engine/campaignRoot", #### Sample djclient.cnfg ```json { "scriptStorageHub": { "method": "FILE", "path": "D:/LiveDropbox/Dropbox/DJSharedData/scripts" }, "campaignRootPath": "D:/Datajet/campaignRootPath", "SequenceEndpoint": "https://devaccpri.datajet.app/api/0/sequence", "pathSubs": [ { "from": "/home/", "to": "/mnt/shared/" }, { "from": "------------d:/datajet/dj-localhost/Demonstration", "to": "k:" } ] } ```