Skip to main content

Marketing Influence Server

Overview

The Marketing Influence Server specializes in analyzing marketing influence and attribution data. It helps you understand how marketing activities contribute to conversions and revenue across different touchpoints and channels.

Server Details

  • Server Name: marketing-influence-server
  • Version: 0.0.1
  • Endpoint: /mcp/marketing-influence
  • Authentication: Organization-level required

Purpose

Analyze marketing attribution, track campaign influence on conversions, understand multi-touch attribution across the customer journey, and measure marketing's impact on revenue generation.

Available Tools

1. system-report-schema-tool

Purpose: Get field mappings for the SystemReport index

When to use: Before constructing queries to understand available fields

Returns: Elasticsearch mapping with field names, types, and descriptions

2. system-report-compute-tool

Purpose: Execute Elasticsearch queries against the SystemReport index

Input: Elasticsearch query JSON Returns: Query results with attribution data and aggregations

3. milestones-tool

Purpose: Retrieve configured milestones for your organization

When to use: At the start of any marketing influence analysis to identify MQL, SQL, and Conversion milestones

Returns: Table of available milestones with their flags

4. terminology-tool

Purpose: Translate abbreviations and business terms, including attribution models

Returns: Guide to attribution models (First Touch, Last Touch, Linear, Position Based, etc.)

5. chart-format-tool

Purpose: Generate Chart.js configurations for visualizing marketing data

Key Concepts

Attribution Models

Marketing influence uses various attribution models to credit marketing touchpoints:

  • First Touch (ptc-first-touch): Credits the first touchpoint in the customer journey
  • Last Touch (ptc-last-touch): Credits the last touchpoint before conversion
  • Linear (ptc-linear): Distributes credit equally across all touchpoints
  • Position Based (ptc-position-based): Credits first and last touchpoints more heavily (40-40-20)
  • Milestone (ptc-milestone): Credits touchpoints at specific milestones
  • Marketing Influenced (ptc-marketing-influenced): Credits all marketing touchpoints

Key Fields

Attribution Fields

  • First Touch Channel - First marketing channel
  • First Touch UTM Source - First UTM source
  • First Touch UTM Medium - First UTM medium
  • First Touch UTM Campaign - First UTM campaign
  • First Touch Date - Date of first touch

Milestone Fields

  • Milestone names (e.g., "Signup", "Demo Request", "Paid Conversion") - Use exact names from milestones-tool
  • Each milestone has a date field when it occurred

Revenue Fields

  • Revenue - Revenue amount
  • Deal Value - Deal value

Engagement Fields

  • Page Views - Number of page views
  • Unique Pages - Number of unique pages visited
  • Total Active Time - Total time spent (seconds)

Common Use Cases

1. Marketing Influenced Conversions

Workflow:

  1. Call milestones-tool to identify Conversion milestone name
  2. Query for conversions with marketing touchpoints:
{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"exists": {"field": "First Touch Channel"}},
{"range": {"Paid Conversion": {"gte": "now-30d/d"}}}
]
}
},
"_source": ["First Touch Channel", "First Touch UTM Campaign", "Revenue", "Paid Conversion"],
"size": 100
}

2. Revenue by Channel (First Touch Attribution)

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"exists": {"field": "Revenue"}},
{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}
]
}
},
"size": 0,
"aggs": {
"by_channel": {
"terms": {
"field": "First Touch Channel.keyword",
"size": 20,
"order": {"total_revenue": "desc"}
},
"aggs": {
"total_revenue": {
"sum": {"field": "Revenue"}
},
"conversion_count": {
"value_count": {"field": "Paid Conversion"}
},
"avg_deal_value": {
"avg": {"field": "Revenue"}
}
}
}
}
}

3. Campaign Performance Analysis

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}
]
}
},
"size": 0,
"aggs": {
"by_campaign": {
"terms": {
"field": "First Touch UTM Campaign.keyword",
"size": 20,
"order": {"total_revenue": "desc"}
},
"aggs": {
"total_revenue": {
"sum": {"field": "Revenue"}
},
"conversions": {
"value_count": {"field": "Paid Conversion"}
},
"avg_revenue": {
"avg": {"field": "Revenue"}
}
}
}
}
}

4. MQL to SQL Conversion Rate by Channel

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Signup"}},
{"range": {"Signup": {"gte": "now-90d/d"}}}
]
}
},
"size": 0,
"aggs": {
"by_channel": {
"terms": {"field": "First Touch Channel.keyword", "size": 20},
"aggs": {
"mqls": {
"filter": {"exists": {"field": "Signup"}}
},
"sqls": {
"filter": {"exists": {"field": "Demo Request"}}
},
"conversion_rate": {
"bucket_script": {
"buckets_path": {
"mqls": "mqls>_count",
"sqls": "sqls>_count"
},
"script": "params.mqls > 0 ? (params.sqls / params.mqls) * 100 : 0"
}
}
}
}
}
}

5. Time to Conversion by Channel

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"exists": {"field": "First Touch Date"}},
{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}
]
}
},
"size": 0,
"aggs": {
"by_channel": {
"terms": {"field": "First Touch Channel.keyword", "size": 20},
"aggs": {
"avg_time_to_conversion": {
"avg": {
"script": {
"source": "doc['Paid Conversion'].value.toInstant().toEpochMilli() - doc['First Touch Date'].value.toInstant().toEpochMilli()",
"lang": "painless"
}
}
}
}
}
}
}

6. Multi-Touch Journey Analysis

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"range": {"Page Views": {"gte": 5}}},
{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}
]
}
},
"_source": [
"First Touch Channel",
"First Touch UTM Campaign",
"Page Views",
"Unique Pages",
"First Touch Date",
"Paid Conversion",
"Revenue"
],
"sort": [{"Revenue": "desc"}],
"size": 100
}

7. UTM Source Performance

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Signup"}},
{"range": {"Signup": {"gte": "now-30d/d"}}}
]
}
},
"size": 0,
"aggs": {
"by_source": {
"terms": {
"field": "First Touch Utm Source.keyword",
"size": 20,
"order": {"mql_count": "desc"}
},
"aggs": {
"mql_count": {
"value_count": {"field": "Signup"}
},
"sql_count": {
"filter": {"exists": {"field": "Demo Request"}}
},
"conversion_count": {
"filter": {"exists": {"field": "Paid Conversion"}}
}
}
}
}
}

8. Revenue Trend Over Time

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"exists": {"field": "Revenue"}},
{"range": {"Paid Conversion": {"gte": "now-180d/d"}}}
]
}
},
"size": 0,
"aggs": {
"revenue_by_week": {
"date_histogram": {
"field": "Paid Conversion",
"calendar_interval": "week"
},
"aggs": {
"total_revenue": {
"sum": {"field": "Revenue"}
},
"conversion_count": {
"value_count": {"field": "Paid Conversion"}
},
"avg_deal_size": {
"avg": {"field": "Revenue"}
}
}
}
}
}

9. Channel Mix Analysis

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Signup"}},
{"range": {"Signup": {"gte": "now-90d/d"}}}
]
}
},
"size": 0,
"aggs": {
"channel_distribution": {
"terms": {"field": "First Touch Channel.keyword", "size": 15},
"aggs": {
"by_medium": {
"terms": {"field": "First Touch UTM Medium.keyword", "size": 10}
}
}
}
}
}

10. High-Value Conversions by Source

{
"query": {
"bool": {
"filter": [
{"exists": {"field": "Paid Conversion"}},
{"range": {"Revenue": {"gte": 10000}}},
{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}
]
}
},
"_source": [
"First Touch Utm Source",
"First Touch UTM Campaign",
"Revenue",
"Paid Conversion",
"First Touch Date"
],
"sort": [{"Revenue": "desc"}],
"size": 50
}

Best Practices

1. Always Call milestones-tool First

Before any marketing influence analysis, call the milestones tool to get correct milestone names.

2. Use Exact Milestone Names

When filtering by milestones, use the exact name from the milestones tool (case-sensitive).

3. Apply Date Filters

Always include date range filters for performance and relevance:

{"range": {"Paid Conversion": {"gte": "now-90d/d"}}}

Unless exact match is explicitly requested:

{"wildcard": {"First Touch UTM Campaign": "*brand*"}}

5. Combine Attribution Fields

Use multiple attribution fields for comprehensive analysis:

{
"query": {
"bool": {
"filter": [
{"term": {"First Touch Channel.keyword": "Paid Search"}},
{"wildcard": {"First Touch UTM Campaign": "*brand*"}},
{"term": {"First Touch UTM Medium.keyword": "cpc"}}
]
}
}
}

6. Calculate Conversion Rates

Use bucket_script in aggregations for rate calculations:

{
"bucket_script": {
"buckets_path": {
"mqls": "mqls>_count",
"conversions": "conversions>_count"
},
"script": "params.mqls > 0 ? (params.conversions / params.mqls) * 100 : 0"
}
}

7. Exclude Null Revenue

When analyzing revenue, filter out null values:

{
"query": {
"bool": {
"must": [
{"exists": {"field": "Revenue"}},
{"range": {"Revenue": {"gt": 0}}}
]
}
}
}

Query Patterns

Multi-Stage Funnel Analysis

{
"size": 0,
"aggs": {
"by_channel": {
"terms": {"field": "First Touch Channel.keyword", "size": 20},
"aggs": {
"mqls": {"filter": {"exists": {"field": "Signup"}}},
"sqls": {"filter": {"exists": {"field": "Demo Request"}}},
"conversions": {"filter": {"exists": {"field": "Paid Conversion"}}},
"total_revenue": {
"sum": {"field": "Revenue"}
}
}
}
}
}

Time-Based Comparison

{
"size": 0,
"aggs": {
"this_month": {
"filter": {"range": {"Paid Conversion": {"gte": "now-30d/d"}}},
"aggs": {
"revenue": {"sum": {"field": "Revenue"}},
"conversions": {"value_count": {"field": "Paid Conversion"}}
}
},
"last_month": {
"filter": {"range": {"Paid Conversion": {"gte": "now-60d/d", "lt": "now-30d/d"}}},
"aggs": {
"revenue": {"sum": {"field": "Revenue"}},
"conversions": {"value_count": {"field": "Paid Conversion"}}
}
}
}
}