Example Project

Get started quickly with a pre-built Infactory project that demonstrates best practices and common use cases for advertising analytics.

Instead of building from scratch, import our example project that includes data sources, query programs, and deployed APIs ready to use.

Import the Example Project

1

Locate the Example Project

The example project file (annalect-example-project.json) was shared in your welcome email.

This project includes:

  • ✅ Pre-configured data source with sample advertising data
  • ✅ 15+ ready-to-use query programs
  • ✅ Deployed APIs for common analytics
  • ✅ Example visualizations in Explore

If you haven’t received the example project file, please check your welcome email or contact your Infactory representative.

2

Import into Infactory

Import the project into your workspace:

  1. Go to the Infactory homepage at https://annalect-workshop.infactory.ai or click the Infactory logo
  2. Look for the “Import Project” button next to “New Project”
  3. Click “Import Project”
  4. Select the downloaded annalect-example-project.json file
  5. Click “Import”
Import project dialog

Import project interface

The project will be imported with all its components ready to use!

3

Explore the Example Project

Once imported, you’ll have access to:

Pre-built Query Programs

Navigate to the Build section to see queries like:

  • Campaign ROAS Analysis - Return on ad spend by campaign
  • Ad Group Performance - Conversion metrics by ad group
  • Cost Efficiency Tracker - CPC and CPM analysis
  • Top Performers - Best campaigns by various metrics
  • Trend Analysis - Performance over time
  • Device Breakdown - Metrics by device type
  • Budget Optimizer - Recommendations for budget allocation
List of pre-built queries

Example queries in the Build section

Deployed APIs

Check the Deploy section to find:

  • All queries already deployed as APIs
  • Direct endpoint URLs for each query
  • Unified natural language endpoint configured
  • API usage examples and documentation

Sample Data

The project includes realistic advertising data with:

  • 50 campaigns across different objectives
  • 200+ ad groups with performance metrics
  • Conversion tracking and attribution data
  • Cost and efficiency metrics
  • Time-series data for trend analysis
4

Customize for Your Needs

Make the example project your own:

  1. Replace the Data Source
    • Go to the data source settings
    • Upload your own CSV or connect your database
    • The queries will automatically work with your data structure
  2. Modify Queries
    • Click any query in the Build section
    • Use the Assistant to adjust calculations
    • Add filters or new metrics
    • Redeploy with one click
  3. Create New Queries
    • Use existing queries as templates
    • Ask the Assistant for help with new analytics
    • Deploy your custom queries as APIs

The example queries are designed to work with common advertising data structures. If your column names are different, the Assistant will help you map them correctly.

What’s in the Example Project

Query Categories

Performance Metrics

  • ROAS by campaign/ad group
  • Conversion rates and values
  • CTR and engagement metrics
  • Attribution analysis

Cost Analysis

  • CPC and CPM trends
  • Budget efficiency scores
  • Spend distribution
  • Cost per acquisition

Optimization

  • Underperforming campaigns
  • Budget reallocation suggestions
  • A/B test results
  • Efficiency improvements

Reporting

  • Executive summaries
  • Weekly performance reports
  • Comparative analysis
  • Custom date ranges

Learning from the Example

Each query in the project demonstrates:

  • Best Practices: Well-structured query programs with clear logic
  • Documentation: Comments explaining the business logic
  • Flexibility: Parameters that make queries reusable
  • Performance: Optimized for fast API responses

Common Modifications

Adapting to Your Data

If your data has different column names, here’s how to adapt:

If your campaign identifier is different:

Original: campaign_id
Yours: campaign_name or marketing_campaign_id

Ask the Assistant: "Update this query to use campaign_name instead of campaign_id"

Using the Example APIs

Once imported, test the APIs immediately:

Via the Workshop Interface

  1. Go to DeployDirect Endpoints
  2. Click any query to test it
  3. Click “Send” to see live results

Via Your Application

import requests

# Your API key from the API Keys section
API_KEY = "your-api-key-here"

# Get campaign ROAS (example endpoint from imported project)
response = requests.get(
    "https://annalect-api.infactory.ai/api/[PROJECT-ID]/campaign-roas",
    headers={"Authorization": f"Bearer {API_KEY}"}
)

data = response.json()
print(data)

Via Natural Language

# Use the unified endpoint for flexible queries
response = requests.post(
    "https://annalect-api.infactory.ai/v1/run/[PROJECT-ID]/chat/completions",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "messages": [{
            "role": "user",
            "content": "What are my top 5 campaigns by ROAS?"
        }],
        "model": "infactory-v1"
    }
)

Next Steps


Pro Tip: The example project is version-controlled. You can always re-import it to get a fresh copy while keeping your customized version separate.