Skip to content

feat: Add UTM Tracking Support for Developer Attribution #388

@mfw78

Description

@mfw78

Problem

The developer community drives significant trading volume through CoW Protocol integrations with zero core team involvement, but we cannot quantify this impact. The Grants Committee needs hard data to demonstrate developer-generated growth to CoW DAO and secure better developer support/resources. Currently, there's no standardized way to track which volume comes from community developers vs other sources.

Suggested solution

Implement automatic UTM tracking in cow-sdk following the [v0.2.0 schema](https://github.com/cowprotocol/app-data/blob/b47139023dea58f8c6d428c49db9d01fd8ad9b54/src/schemas/utm/v0.2.0.json) with these defaults:

{
  "utm": {
    "utmCampaign": "developer-cohort",
    "utmContent": "", // User customizable
    "utmMedium": "cow-sdk@<version>",
    "utmSource": "cowmunity", 
    "utmTerm": "js"
  }
}

Usage examples:

// Default behavior - automatic UTM injection
const order = await cowSdk.createOrder({
  appData: {
    appCode: "myApp"
  }
});
// Result: UTM automatically added alongside existing appData

// Custom utmContent via appData
const order = await cowSdk.createOrder({
  appData: {
    appCode: "myApp",
    utm: {
      utmContent: "my-custom-identifier" // Only override content
    }
  }
});

// Or via SDK configuration
const cowSdk = new CowSdk({
  utmContent: "my-integration-v2" // Sets custom content for all orders
});

Alternatives considered

  1. Manual UTM addition: Requiring developers to manually add UTM codes - rejected because it would have low adoption
  2. Separate analytics SDK: Creating a wrapper library - rejected as it fragments the developer experience
  3. Server-side attribution: Tracking at API level - rejected as it can't distinguish between direct API usage vs SDK usage

Additional context

  • cow-py (Python SDK) is implementing similar tracking: [Issue #61](feat/add-utm-codes-to-orders cowdao-grants/cow-py#61)
  • Discord discussion revealed consensus on UTM field standardization across all SDKs
  • This data is critical for upcoming grant allocation decisions and demonstrating ROI to CoW DAO
  • No core team involvement in driving this developer growth - purely community-driven

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions