> ## Documentation Index
> Fetch the complete documentation index at: https://docs.luklak.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketing Campaigns Function

> [!NOTE]
>
> **Purpose:** This document defines the **internal** operational logic of the Marketing Campaigns `📋 Function`. It covers the management of campaigns and ads to generate and qualify leads before handing them over to the Sales `📋 Function`.

## Why This Matters

> [!NOTE]
>
> This `📋 Function` establishes a standardized and measurable process for managing all advertising activities. It ensures every ad is tracked consistently with automated UTM generation, providing clear data on campaign performance. Strategically, this allows for the precise calculation of lead costs and the overall return on investment for marketing spend. For the marketing team, it streamlines the ad creation and approval process, reducing manual work and enabling a focus on campaign effectiveness.

## The Big Picture

> [!NOTE]
>
> Architecturally, this `📋 Function` serves as the starting point of the customer journey. It is built around two core `🧊 Objects`: the `🧊 Marketing Campaign` and its child, the `🧊︎ Ad`. Its primary output is a qualified lead, which triggers the creation of a `🧊 Customer` in the downstream CRM `📋 Function` via an automated rule. This creates a seamless data flow from the first ad impression to the final sale.

***

## OBJECT TYPES & WORKFLOWS

### 1. 🧊 Marketing Campaign (Standard Object)

* **Process Description**: Serves as the master record for a strategic marketing initiative. It groups multiple `🧊︎ Ads`, defines high-level goals and budgets, and tracks the overall performance of the initiative across all channels.
* **Example**: The *"Scandinavian Simplicity"* campaign, designed to attract new leads for LAIKA's minimalist interior design services by showcasing warmth, functionality, and clean lines.

> [tab] Workflow
>
> **Campaign Workflow**
>
> ![Laika Mkt Campain Pn](https://mintcdn.com/luklak-28b92ec5/6CTmw7UoMje3vLo-/images/laika-flagship-images/function-blueprint/laika-mkt/laika-campaign-workflow.png?fit=max\&auto=format\&n=6CTmw7UoMje3vLo-\&q=85\&s=7e1cf9cc36c6f9a05459d873eff7859c)
>
> ```
> PREPARING → RUNNING ↔ PAUSED → COMPLETED
>                   │              ↓
>                   └──────────> FAILED
> ```

> [tab] Status Details
>
> | Status | Business Logic | Advanced Settings |
> | :- | :- | :- |
> | **1. PREPARING** | The campaign is in the planning phase, defining goals, budget, and preparing ad content. | **Transition Permissions**: Marketing Manager.  **Input Screen**: Requires input in strategic fields (Goal, Budget, Start Date...). |
> | **2. RUNNING** | The campaign is active, and its child `🧊︎ Ad` objects are being served and collecting performance data. | **Transition Permissions**: Marketing Manager, Marketing Lead.  **Automation**: Metrics like Actual Spend and Actual Leads are automatically aggregated from child `🧊︎ Ad` objects. |
> | **3. PAUSED** | The campaign and its child ad objects are temporarily stopped for adjustments or optimization. | **Transition Permissions**: Marketing Manager, Marketing Lead.  **Condition**: Can be moved back to the `RUNNING` status to resume the campaign. |
> | **4. COMPLETED** | The campaign has successfully finished according to its plan and has met its primary objectives. | **Transition Permissions**: Marketing Manager. |
> | **5. FAILED** | The campaign was stopped ahead of schedule because its performance did not meet KPIs or for other strategic reasons. | **Transition Permissions**: Marketing Manager, Marketing Lead. |

> [tab] Data Fields
>
> **Data Field Groups**
>
> | Group | Field Name (Type) | Notes |
> | :- | :- | :- |
> | **Basic Information** *(4 Fields)* | Campaign Name (Text), Start Date (Date), End Date (Date), Status (Status) | Core identifying information for the campaign. |
> | **Budget & Performance** *(7 Fields)* | Target Budget (Currency), Actual Spend (Currency), Target Leads (Number), Actual Leads (Number), Target CPL (Formula), Actual CPL (Formula), Budget Variance (Formula) | Tracks financial and lead generation performance. |
> | **Total: 11 Fields** | | |

***

### 2. 🧊︎ Ad (Sub-Object)

* **Process Description**: Represents a specific creative execution within a parent `🧊 Campaign`. This is the operational Object that holds the ad copy, visual assets, targeting parameters, and the unique tracking `ad_key` essential for lead attribution.
* **Example**: A specific Facebook ad creative under the *"Scandinavian Simplicity"* campaign, featuring a photo of a modern, light-filled living room. This `🧊︎ Ad` Object holds the unique identifier `ad_key: MKT-236`, which is embedded in its URL to track every lead it generates.

> [tab] Workflow
>
> **Ad Workflow**
>
> ![Laika Mkt Ad Pn](https://mintcdn.com/luklak-28b92ec5/6CTmw7UoMje3vLo-/images/laika-flagship-images/function-blueprint/laika-mkt/laika-mkt-ad.png?fit=max\&auto=format\&n=6CTmw7UoMje3vLo-\&q=85\&s=e85a4bb6a92b71835fa40539266480d9)
>
> ```
> DRAFT → PENDING APPROVAL → APPROVED → ACTIVE ↔ PAUSED ┐
>   ↑           ↓                                      ↓
>   └───────── REJECTED                              STOPPED
> ```

> [tab] Status Details
>
> | Status | Business Logic | Advanced Settings |
> | :- | :- | :- |
> | **1. DRAFT** | The ad is being created. The marketing specialist is preparing the copy, creatives, and targeting parameters. | **Transition Permissions**: Marketing Specialist (to submit for approval). |
> | **2. PENDING APPROVAL** | The ad has been submitted for internal review by a manager before it can be approved to run. | **Transition Permissions**: Marketing Manager (to approve or reject). |
> | **3. REJECTED** | The ad was reviewed but did not meet requirements. It is sent back to `DRAFT` with feedback for revision. | **Transition Permissions**: Marketing Specialist (to move back to `DRAFT` after edits). |
> | **4. APPROVED** | The ad has been approved by the manager and is now ready to be activated. | **Transition Permissions**: Marketing Specialist (to move to `ACTIVE`). |
> | **5. ACTIVE** | The ad is live and running in the campaign, actively spending its budget and gathering performance data. | **Transition Permissions**: Marketing Specialist, Marketing Manager (to `PAUSE` or `STOP`). |
> | **6. PAUSED** | The ad has been temporarily deactivated, but can be resumed. No budget is being spent. | **Transition Permissions**: Marketing Specialist, Marketing Manager (to move back to `ACTIVE` or to `STOP`). |
> | **7. STOPPED** | The ad has permanently finished its run and is now an archived, read-only record. | **This is a terminal status and cannot be changed.** |

> [tab] Data Fields
>
> | Group | Field Name (Type) | Notes |
> | :- | :- | :- |
> | **Basic Information** *(4 Fields)* | Campaign Name (Text), Status (Status), Start Date (Date), End Date (Date) | Core identifying information for the campaign. |
> | **Strategy** *(3 Fields)* | Goal (Text), Channel (Select), Description (Rich Text) | Defines the campaign's strategic objectives and the channels used for execution, as seen in the video. |
> | **Budget & Performance** *(7 Fields)* | Target Budget (Currency), Actual Spend (Currency, Roll-up), Target Leads (Number), Actual Leads (Number, Roll-up), Target CPL (Formula), Actual CPL (Formula), Budget Variance (Formula) | Tracks financial and lead-generation performance against targets. Spend and Leads are automatically rolled up from child `🧊︎ Ads`. |
> | **Total: 14 Fields** | | |

***

***

## OBJECT RELATIONSHIPS

| Relationship Type | Connection | Description |
| :- | :- | :- |
| **Parent-Child** | `🧊 Marketing Campaign` → `🧊︎ Ad` | Each `🧊 Marketing Campaign` can contain multiple `🧊︎ Ad` Objects. |

***

## **AUTOMATIONS**

> [!TIP]
>
> You can [open this canvas view](https://mermaid.ink/svg/pako:eNqVV91O40YUfpUjV1pATVJi5wesaiXnj0UkgEgAtWRVTeyxmeLMpONxAqXc9qIXvegL9LKv0OfpC7SP0DNjJ3Eg2W5zEdk-_9_5zvH42fJFQC3XKpfLY-4LHrLIHXMAdU-n1AVJg_RxdX9DJCOTmCZGBWAm2ZTIp7aIhXRh7wunfuT1ensbwhF9VCsFu-rU6sebCi0hAypXKk2n1Vn5iBmn270nFJMNisHbTbSr5WJFpWJFaa_Wq_eauXRC_IdIipQHRmR-uWhKGG89RG-eZ_GWkqIzLhTdXaSWotVK2G31vF63KNws33Ha7VVQ4isht2WTCYzldqPdCRlxv4hr1-52e8erOn9IKffpeTqdFNJ6HZ3NiWKC_0fyS61d9cdCzHZnGpMJjVviccO8mOtK4VMM0jq7YyQs4iReyRq1ZvWotSHbbmvGZYlVh5FIkmnOPKZiCn3v9MyDMvSvz_reGQy_GY66A31P5zQGx4UBkQ9UMR5Bm0xnBEMl0Eu5r_GCG0YXOYipEty0YswL_YPhZbcNJCm4Gc6oz0jMElXUG5xcbaoNCCfR2ttEPIKMJmTfrtdLsP47rNQPPpljZm7GmOCo-WxGuIK2N9Dh_vn9j1-2WG-38TpLk7___BW8INOiPPisHC9wMclVVsn2EBejDzrGK134f5G6j7hUkBAwfEoUne4Iddtt6VBZ_2_pJGGKvolzjnMPYk6zPpawSS70-he3UEWKeAG0JTWDA-_Am82kmJM4M9Tq5ffvv0Sc3UyLAqeLVwgHNJ89qhuyDLq09Tobphhuf6iIShMXOldeb3SQqXudMmpr5btM2y306OPXE_nV-79-_g08JGg5opxK7ZAE3z3Qp0KRkkX3CkQI2pEHKWc4MoA6sE8rUaUEg7NR2XYaB8ASWLoJjPcQ6RtTEgBRSrJJqgGpvCpGex2mkylToNWXYMH-OtWf4LJ73jk9PwHv8vLq4sbr5wUi6rmHzIwaKIqGmUG3c7CtINO00xDfkN9TH3Mu6VckAgALkcYBPlap5KBEBqqpKDEww4KpewgpDfRryOStLdfzW3nTRa-zgzmGB4Y5NjIHXXAkD1JbxCwg6zEttv56FmiXe56vUk1mbbMHIaNxUGx8RrG7TLvY-krRcM2DKxHH5XQGickBy8ahoDgPueEmQTeRNJFGCMEr3b3kdZbIEb0Qp1iaT-L4yUSXFK_9NNbEqWwfgM-FE_dEDqeDcJ6Icp8hLd7h1sa-fiA8EGG4iSiOO6K0RgeQNe3R6U13jUyf4MK5x6PMPKOH7v71aKDPNg-AhwqFJw69JbPZKRk7Q3z9cM5wgQiZaEQXxW1SKAdzWNaDl6Z5ppA7XD_3Qjx8hJ6Q03xOltOlM8u3gM6-nSaIK-Jg0stSAcZ1ottaZvx7Zn9sWIuJHgbdJ9_4DrQPZLcJOSR4ckQ021cDCPMlvBpo9KgzzxIvLpyl7wKgGjjEIxGp9OmbN8eWTDW5ErO1IU0wh2xSTY2hFFNzv8jAMlHQecg0jbXdOgq2FzmQNU6L1ELkFSdviYeBrZIVSRZYrpIpLVlYBJ4u8dZ61tpjy5ypx5aLlwENSRqrsTXmL2iGr5JvhZguLfGoGt1bbkjiBO9SM5P5oWOlggOiz0ApV5ZrN4wLy322Hi23WqtWGoeHzVqjZh828VeynvCpfVyxnSPn2LEd267VGvZLyfrRBD2sNOvVZu3YcRrN6nEdNUsWDTQPB9nHgvlmePkXS-j08Q) for better readability

![Laika Mkt Function Sequence Pn](https://mintcdn.com/luklak-28b92ec5/6CTmw7UoMje3vLo-/images/laika-flagship-images/function-blueprint/laika-mkt/laika-mkt-campaign.png?fit=max\&auto=format\&n=6CTmw7UoMje3vLo-\&q=85\&s=caecb2e30d93564f46f4f21a558f5b1e)

LAIKA - Marketing Campaigns Function

> [tab] Within Function
>
> > [!NOTE]
> >
> > This table outlines the automations that run entirely within the `⏹️ Marketing` Space to manage campaign data and efficiency.
>
> | ID | Rule Name | Trigger | Action | Description |
> | :- | :- | :- | :- | :- |
> | **IN-01** | Generate Ad Key | **Create**: A new `🧊︎ Ad` is created | **Update**: `🧊︎ Ad` | Automatically generates and assigns a unique `ad_key` to the `🧊︎ Ad` used for external tracking.  *`For example, the key MKT-236 was generated for the 'Scandinavian Simplicity' ad`*. |
> | **IN-02** | Consolidate Ad Spend to Campaign | **Update**: `🧊︎ Ad` Field `Actual Spend` | **Update**: `🧊 Campaign` | When the `Actual Spend` on an `🧊︎ Ad` is updated, this rule automatically aggregates the total spend to the parent `🧊 Campaign`'s `Actual Spend` field. |

> [tab] Cross Function
>
> > [!NOTE]
> >
> > This table shows the rule that connects an external system (the LAIKA website) to the Luklak platform, serving as the bridge between Marketing's efforts and a tangible lead.
>
> | ID | Rule Name | Trigger | Action | Description |
> | :- | :- | :- | :- | :- |
> | **CS-01** | Receive & Attribute Lead from Website | **Webhook**: Website form is submitted | **Create**: `Sales & CRM/🧊Customer` | A form submission on the website triggers the creation of a new `🧊 Customer` Object within the `⏹️ Sales & CRM` Space. The automation uses the `ad_key` captured from the URL to perform the handoff described in rule `CF-01` below. |

> [tab] Cross System
>
> > [!NOTE]
> >
> > This table describes the critical handoff of attribution data from the `⏹️ Marketing` Space to the `⏹️ Sales & CRM` Space, ensuring the sales team has full context.
>
> | ID | Rule Name | Trigger | Action | Description |
> | :- | :- | :- | :- | :- |
> | **CF-01** | Link New Lead to Source Ad | **Create**: `Sales & CRM/🧊Customer` | **Update**: `Sales & CRM/🧊Customer` | Triggered by rule `CS-01`, this automation populates a field on the new `🧊 Customer` linking it to the source `Marketing/🧊 Ad`. *This is how Sarah's new lead Object was automatically linked to the 'Scandinavian Simplicity' ad*. |

***

## WORKVIEWS, DASHBOARDS, FILTERS & REMINDERS

> [tab] Workviews
>
> | Workview | Description | Data Configuration |
> | :- | :- | :- |
> | 1. **Kanban Ad Pipeline** | Displays all `🧊︎ Ad` Objects as cards, organized in columns by their status (Draft, Pending, Active, etc.). | All `🧊︎ Ad` Objects, grouped by status, sorted by creation date. |

> [tab] Dashboards
>
> | Widget | Data | Description |
> | :- | :- | :- |
> | 1. **Lead Conversion Funnel** | Tracks the conversion rate from ad impressions to leads generated to contracts signed (data from CRM). | Analyzes the end-to-end effectiveness of the marketing and sales pipeline. |
> | 2. **Campaign Performance Chart** | Bar chart comparing the `Actual CPL` (Cost Per Lead) of all `RUNNING` campaigns. | Provides a clear comparison of which campaigns are most cost-effective at generating leads. |

> [tab] Filters
>
> | Filter | Criteria | Reminder |
> | :- | :- | :- |
> | 1. **Underperforming Campaigns** | Status = "RUNNING" AND Actual CPL > Target CPL. | Daily at 9:00 AM to the Marketing Manager role. |
> | 2. **Ads Pending Review** | Status = "PENDING APPROVAL" AND has been in status for > 24 hours. | Daily at 10:00 AM to the Marketing Manager role. |

## **ROLES, PERMISSIONS & NOTIFICATIONS**

* **Roles Used:** References the predefined **Global Roles**: `Marketing Manager`, `Marketing Executive`.
* **Permission Scheme:** Utilizes **Global Scheme 3: Moderate Permissions**.
* **Notification Scheme:** Utilizes **Global Scheme 2: Notify All Stakeholders**.

***

## What's Next?

* [**CRM (Business) Function**](https://claude.ai/chat/path/to/crm-function): See what happens in the next stage after this function generates a qualified lead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.