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

Conversion Destination Manager

Build a Python application that manages conversion tracking destinations for a merchant account in Google Merchant Center. The application should provide functionality to create, configure, and update conversion destinations with proper attribution settings.

Requirements

Your application should implement the following features:

  1. Create a new conversion destination with:

    • A display name
    • A currency code (e.g., "USD", "EUR")
    • An attribution model (one of: "LAST_CLICK", "FIRST_CLICK", "LINEAR", "TIME_DECAY", "POSITION_BASED", "DATA_DRIVEN")
  2. Update an existing conversion destination to modify:

    • The display name
    • The attribution settings
  3. Retrieve destination information to verify the configuration was applied correctly

  4. Handle errors appropriately when invalid configurations are provided

Implementation Details

  • Create a module conversion_manager.py that contains a class ConversionDestinationManager
  • The class should be initialized with a merchant account identifier
  • Implement methods for creating, updating, and retrieving destinations
  • Ensure partial updates work correctly without affecting unmodified fields

Test Cases

  • Creating a destination with display name "Online Store Sales", currency "USD", and "LAST_CLICK" attribution returns a valid destination identifier @test
  • Updating only the display name of an existing destination preserves the currency and attribution settings @test
  • Retrieving a destination by identifier returns the correct configuration details @test
  • Attempting to create a destination with an invalid currency code raises an appropriate error @test

API

class ConversionDestinationManager:
    """Manages conversion tracking destinations for a merchant account."""

    def __init__(self, merchant_id: str):
        """Initialize the manager with a merchant account ID.

        Args:
            merchant_id: The merchant account identifier
        """
        pass

    def create_destination(self, display_name: str, currency_code: str, attribution_model: str) -> str:
        """Create a new conversion destination.

        Args:
            display_name: The display name for the destination
            currency_code: The currency code (e.g., "USD", "EUR")
            attribution_model: The attribution model to use

        Returns:
            The identifier of the created destination

        Raises:
            ValueError: If any parameter is invalid
        """
        pass

    def update_destination(self, destination_id: str, display_name: str = None, attribution_model: str = None) -> None:
        """Update an existing conversion destination.

        Args:
            destination_id: The identifier of the destination to update
            display_name: The new display name (optional)
            attribution_model: The new attribution model (optional)

        Raises:
            ValueError: If the destination does not exist or parameters are invalid
        """
        pass

    def get_destination(self, destination_id: str) -> dict:
        """Retrieve destination information.

        Args:
            destination_id: The identifier of the destination

        Returns:
            A dictionary containing destination details with keys:
            - 'destination_id': str
            - 'display_name': str
            - 'currency_code': str
            - 'attribution_model': str
            - 'state': str

        Raises:
            ValueError: If the destination does not exist
        """
        pass

Dependencies { .dependencies }

google-shopping-merchant-conversions { .dependency }

Provides the Google Shopping Merchant Conversions API client for managing conversion sources and destinations.

@satisfied-by

Version

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