Google Shopping Merchant Conversions API client library for managing conversion sources and tracking.
82
A utility that efficiently processes multiple conversion sources in parallel for a Google Merchant Center account.
Build a system that performs batch operations on conversion sources using asynchronous operations for optimal performance.
The system must:
Batch Creation:
Batch Retrieval:
Paginated Listing:
@generates
import asyncio
from typing import List, Dict, Any
async def batch_create_conversion_sources(
merchant_id: str,
conversion_configs: List[Dict[str, Any]]
) -> List[str]:
"""
Creates multiple conversion sources concurrently.
Args:
merchant_id: The merchant account identifier (format: "accounts/{account_id}")
conversion_configs: List of dicts containing:
- display_name: str
- currency_code: str (e.g., "USD")
- attribution_model: str (e.g., "LAST_CLICK")
Returns:
List of created conversion source identifiers (full resource names)
"""
pass
async def batch_retrieve_conversion_sources(
conversion_source_ids: List[str]
) -> List[Any]:
"""
Retrieves multiple conversion sources in parallel.
Args:
conversion_source_ids: List of conversion source resource names
Returns:
List of conversion source objects
"""
pass
async def list_all_conversion_sources(merchant_id: str) -> List[Any]:
"""
Lists all conversion sources for a merchant, handling pagination.
Args:
merchant_id: The merchant account identifier (format: "accounts/{account_id}")
Returns:
List of all conversion source objects across all pages
"""
passProvides API client for managing conversion sources in Google Merchant Center.
test/batch_create.test.py - Tests concurrent creation of conversion sourcestest/batch_retrieve.test.py - Tests parallel retrieval of conversion sourcestest/paginated_list.test.py - Tests paginated listing with async iterationInstall with Tessl CLI
npx tessl i tessl/pypi-google-shopping-merchant-conversionsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10