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-3/

Conversion Tracking Setup Service

Build a service to initialize conversion tracking for an e-commerce merchant. The service should create conversion tracking sources to measure advertising effectiveness across different channels.

Requirements

Your service must support creating two types of conversion sources:

  1. Analytics Integration: Create a source that links to an existing analytics property using a property identifier
  2. Direct Tracking: Create a source for direct conversion tracking with configurable settings

For both types:

  • Accept a merchant account identifier
  • Accept a display name for the source
  • Return the created source identifier and current state

For direct tracking sources, also support:

  • Configuring the currency code for conversions
  • Setting an attribution model (options: "last_click", "data_driven", "first_click")

API

def create_analytics_source(merchant_id: str, display_name: str, property_id: str) -> dict:
    """
    Create a conversion source linked to an analytics property.

    Args:
        merchant_id: The merchant account identifier
        display_name: Human-readable name for the source
        property_id: The analytics property identifier

    Returns:
        dict with keys: 'source_id', 'state', 'display_name'
    """
    pass

def create_direct_source(
    merchant_id: str,
    display_name: str,
    currency_code: str,
    attribution_model: str = "last_click"
) -> dict:
    """
    Create a direct conversion tracking source.

    Args:
        merchant_id: The merchant account identifier
        display_name: Human-readable name for the source
        currency_code: 3-letter ISO currency code (e.g., 'USD', 'EUR')
        attribution_model: Attribution model ('last_click', 'data_driven', or 'first_click')

    Returns:
        dict with keys: 'source_id', 'state', 'display_name', 'currency_code'
    """
    pass

Test Cases

  • Creating an analytics source with merchant ID "accounts/12345", display name "GA4 Store", and property ID "properties/98765" returns a dict with 'source_id', 'state', and 'display_name' keys @test
  • Creating a direct source with merchant ID "accounts/12345", display name "Direct Conversions", and currency "USD" returns a dict with 'source_id', 'state', 'display_name', and 'currency_code' keys @test
  • Creating a direct source with data-driven attribution returns a source with the correct attribution model configured @test

@generates

Dependencies { .dependencies }

google-shopping-merchant-conversions { .dependency }

Provides the API client for managing conversion sources in Google Merchant Center.

@satisfied-by

Version

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