Google Shopping Merchant Conversions API client library for managing conversion sources and tracking.
82
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.
Your implementation must:
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.
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.
Create a function list_channel_attributions(merchant_id) that retrieves all conversion sources for a merchant account and returns their attribution configurations.
Support the following attribution models:
Handle attribution lookback windows ranging from 7 to 90 days.
accounts/{account_id}accounts/{account_id}/conversionSources/{source_id}Input:
merchant_id = "accounts/12345"
channel = "social_media"
model = "last_click"
lookback = 30
currency = "USD"Expected Behavior:
Input:
merchant_id = "accounts/12345"
source_name = "accounts/12345/conversionSources/conv_001"
new_model = "data_driven"
new_lookback = 60Expected Behavior:
Input:
merchant_id = "accounts/12345"Expected Behavior:
Provides conversion source management and attribution configuration for Google Merchant Center.
Create your test cases in: test_attribution_system.py
Install 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