Ctrl + K
DocumentationLog inGet started

tessl/pypi-google-shopping-merchant-conversions

tessl install tessl/pypi-google-shopping-merchant-conversions@1.0.0

Google Shopping Merchant Conversions API client library for managing conversion sources and tracking.

Agent Success

Agent success rate when using this tile

82%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.17x

Baseline

Agent success rate without this tile

70%

task.mdevals/scenario-8/

Multi-Channel Attribution Configuration System

Overview

Build a conversion tracking system that creates and configures conversion sources with different attribution models for multiple marketing channels. The system should support various attribution strategies and lookback windows to accurately measure marketing effectiveness across channels.

Requirements

Your implementation must:

  1. Create a function create_channel_conversion_source(merchant_id, channel_name, attribution_model, lookback_days, currency_code) that creates a new Merchant Center Destination conversion source for a marketing channel with specified attribution settings.

  2. Create a function update_attribution_model(merchant_id, source_name, new_model, new_lookback_days) that updates an existing conversion source's attribution model and lookback window.

  3. Create a function list_channel_attributions(merchant_id) that retrieves all conversion sources for a merchant account and returns their attribution configurations.

  4. Support the following attribution models:

    • Last click
    • First click
    • Linear
    • Time decay
    • Position-based
    • Data-driven
  5. Handle attribution lookback windows ranging from 7 to 90 days.

Implementation Notes

  • The merchant account identifier will be provided in the format accounts/{account_id}
  • Conversion source names should follow the pattern: accounts/{account_id}/conversionSources/{source_id}
  • All currency codes should be valid ISO 4217 codes (e.g., "USD", "EUR", "GBP")
  • The system should handle both creation and update operations gracefully
  • Attribution settings should be properly validated before applying

Test Cases

Test Case 1: Create Social Media Conversion Source @test

Input:

merchant_id = "accounts/12345"
channel = "social_media"
model = "last_click"
lookback = 30
currency = "USD"

Expected Behavior:

  • Creates a new conversion source with display name "social_media"
  • Configures last click attribution model
  • Sets 30-day lookback window
  • Uses USD currency
  • Returns the created conversion source resource

Test Case 2: Update Attribution Model @test

Input:

merchant_id = "accounts/12345"
source_name = "accounts/12345/conversionSources/conv_001"
new_model = "data_driven"
new_lookback = 60

Expected Behavior:

  • Updates the existing conversion source
  • Changes attribution model to data-driven
  • Sets lookback window to 60 days
  • Returns the updated conversion source

Test Case 3: List All Channel Attributions @test

Input:

merchant_id = "accounts/12345"

Expected Behavior:

  • Retrieves all conversion sources for the merchant
  • Returns a list/dict containing each source's:
    • Source identifier
    • Display name
    • Attribution model(s) configured
    • Lookback window
    • Currency code
    • Current state (ACTIVE, ARCHIVED, etc.)

Dependencies { .dependencies }

google-shopping-merchant-conversions { .dependency }

Provides conversion source management and attribution configuration for Google Merchant Center.

Test File

Create your test cases in: test_attribution_system.py

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/google-shopping-merchant-conversions@1.0.x
tile.json