판매자는 Google에서 비즈니스 정보에 모금 캠페인 링크를 추가할 수 있습니다. 캠페인 피드는 캠페인 제공업체에서 모든 캠페인의 이전 날짜 결과에 대한 측정항목을 전송하는 데 사용됩니다. 캠페인 피드는 설명자 파일의 'name' 값이 'fundraising.campaign'으로 설정된 일반 보관용 계정을 사용합니다. 일반 보관용 계정을 사용하는 방법은 이 튜토리얼을 참조하세요. proto 사양은 샘플 JSON 피드와 함께 아래에서 확인할 수 있습니다.
Proto 사양
아래 사양은 Proto 형식으로 제공됩니다. 피드에서 사용할 수 있는 모든 필드를 정의하는 데 사용됩니다. 일반 보관용 계정에 업로드할 때 JSON 샘플에 설명된 대로 JSON 형식을 사용할 수도 있습니다.
캠페인 피드 정의
message CampaignFeed { repeated Campaign data = 1; }
캠페인 정의
message Campaign { // Unique identifier for the campaign. (required) // (Note: could be the same as the campaign url if that's the only unique // identifier the partner uses. This will mainly be used for identification // when Google and partners communicate issues for a particular campaign // entry.) string campaign_id = 1; // Whether this campaign entry is active (i.e. able to accept donation) or // inactive. (required) CampaignStatus campaign_status = 2; // The campaign url that merchants might upload to Google if they have a // campaign set up with the partner. (required) string campaign_url = 3; // Name/title of the campaign. (optional) string campaign_title = 4; // More detailed description of the campaign. (optional) string campaign_description = 5; // The start/publish timestamp for the campaign. Format: Seconds of UTC time // since the Unix epoch. (optional) int64 campaign_start_sec = 6; // The end timestamp for the campaign. Format: Seconds of UTC time since the // Unix epoch. (optional) int64 campaign_end_sec = 7; // The monetary amount for the campaign goal. (optional) MonetaryAmount campaign_goal = 8; // The date in YYYY-MM-DD format indicating when the // amount_contributed_previous_day and num_of_transactions_previous_day data // below are retrieved. Should always be one day after the date which the // stats in xxx_previous_day corresponds to. UTC timezone should be used to // delineate which transactions fall on which dates. // E.g. if the amount_contributed_previous_day corresponds to the amount // contributed yesterday, then the data_retrieval_date here should be set as // today's date. The feed must include all campaign entries for the given date // (no partial uploads). (required) string data_retrieval_date = 9; // Previous day's monetary amount contributed through the Enhanced User // Referral Feature(s) to this campaign. (required) MonetaryAmount amount_contributed_previous_day = 10; // Previous day's number of transactions through the Enhanced User Referral // Feature(s) for this campaign. (required) int32 num_transactions_previous_day = 11; // Information about the merchant that initiated the campaign. (required) MerchantInfo merchant_info = 12; }
캠페인 상태 정의
message CampaignStatus { enum Status { // Unused. STATUS_UNSPECIFIED = 0; // Able to accept donation. ACTIVE = 1; // Unable to accept donation. INACTIVE = 2; } Status status = 1; }
판매자 정의
message MerchantInfo { // Unique identifier for the merchant. // (recommended for Campaign feed, required for others) string merchant_id = 1; // Name of the merchant that initiated the campaign. // (recommended for Campaign feed, required for others) string merchant_name = 2; // Unstructured address of the merchant that initiated the gift card. // (optional) // E.g. "1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043" string merchant_address_unstructured = 3; // Structured address of the merchant that initiated the gift card. (required) PostalAddress merchant_postal_address = 4; // Business category of the merchant, e.g. restaurant. (optional) // See https://developers.google.com/places/supported_types for possible // categories. string merchant_category = 5; }
금액 정의
message MonetaryAmount { // The monetary amount in centi-units of the currency. // For example: 1.95 USD is 195 in centi-units. // If your amount contains fractions of the smallest currency unit, then it // will be rounded using nearest even rounding (e.g. 2.5 cents rounded // to 2 cents, 3.5 cents rounded to 4 cents, 0.5 cents rounded to 0 cents, // 2.51 cents rounded to 3 cents). (required) int64 monetary_amount_centi = 1; // The currency of the price that is defined in ISO 4217. (required) string currency_code = 2; }
우편 주소 정의
// The postal address for a merchant. message PostalAddress { // The country, e.g. "US". (required) string country = 1; // The locality/city, e.g. "Mountain View". (required) string locality = 2; // The region/state/province, e.g. "CA". This field is only required in // countries where region is commonly a part of the address. (optional) string region = 3; // The postal code, e.g. "94043". (required) string postal_code = 4; // The street address, e.g. "1600 Amphitheatre Pkwy". (optional) string street_address = 5; }
캠페인 예(JSON 형식)
아래 JSON 예에는 전날 2건의 거래가 있었던 Jetters Pizza에 대한 활성 캠페인이 하나 있습니다. Google 사용자의 전날 거래 금액은 50.00달러였으며 캠페인의 총 목표 금액은 20,000.00달러입니다. 이 파일 외에도 설명자 파일을 설명자 파일의 'name' 값이 'fundraising.campaign'으로 설정된 일반 보관용 계정에 업로드해야 합니다. 일반 보관용 계정을 사용하는 방법에 대한 자세한 내용은 이 가이드를 참조하세요.
{ "data": [ { "campaign_id": "1", "campaign_status": { "status": "ACTIVE" }, "campaign_url": "www.example.com/jetterspizza", "campaign_title": "Fundraiser for Jetters Pizza", "campaign_start_sec": 1546300800, "campaign_goal": { "monetary_amount_centi": 2000000, "currency_code": "USD" }, "data_retrieval_date": "2020-04-24", "amount_contributed_previous_day": { "monetary_amount_centi": 5000, "currency_code": "USD" }, "num_transactions_previous_day": 2, "merchant_info": { "merchant_id": "A", "merchant_name": "Jetters Pizza", "merchant_address_unstructured": "1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043", "merchant_postal_address": { "country": "United States", "region": "CA", "postal_code": "94043", "street_address": "1600 Amphitheatre Pkwy", "locality": "Mountain View" }, "merchant_category": "restaurant" } } ] }