Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Les marchands ont la possibilité d'ajouter des liens vers des pages d'achat de cartes cadeau à leur fiche sur Google. Le flux cartes cadeau permet à la plate-forme de cartes cadeau d'envoyer des statistiques sur les résultats des jours précédents pour toutes les cartes. Le flux de cartes cadeaux utilise le serveur SFTP générique, avec la valeur "name" dans le fichier descripteur définie sur "fundraising.giftcard". Pour savoir comment utiliser le serveur SFTP générique, consultez ce tutoriel.
Vous trouverez ci-dessous la spécification au format proto, ainsi qu'un exemple de flux JSON.
Spécification au format proto
La spécification ci-dessous est disponible au format proto. Elle permet de définir tous les champs disponibles dans le flux. Lors de l'importation sur le serveur SFTP générique, vous pouvez également utiliser le format JSON, comme illustré dans l'exemple JSON.
Flux cartes cadeau – Définition
message GiftCardFeed {
repeated GiftCard data = 1;
}
Carte cadeau – Définition
messageGiftCard{//Uniqueidentifierforthegiftcard.(required)//(Note:couldbethesameasthegiftcardurlifthat's the only unique//identifierthepartneruses.Thiswillmainlybeusedforidentification//whenGoogleandpartnerscommunicateissuesforaparticulargiftcard//entry.)stringgift_card_id=1;//Whetherthisgiftcardentryisactive(i.e.abletobepurchased)or//inactive.(required)GiftCardStatusgift_card_status=2;//Thegiftcardurlontheplatform.(required)stringgift_card_url=3;//ThedateinYYYY-MM-DDformatindicateswhenthe//amount_contributed_previous_dayandnum_of_transactions_previous_daydata//belowareretrieved.Shouldalwaysbeonedayafterthedatewhichthe//statsinxxx_previous_daycorrespondsto.UTCtimezoneshouldbeusedto//delineatewhichtransactionsfallonwhichdates.//E.g.iftheamount_contributed_previous_daycorrespondstotheamount//contributedyesterday,thenthedata_retrieval_datehereshouldbesetas//today's date. (required)//Thefeedmustincludeallgiftcardentriesforthegivendate(nopartial//uploads).(required)stringdata_retrieval_date=4;//Previousday's monetary amount contributed through the Enhanced User//ReferralFeature(s)tothisgiftcardprogram.(required)MonetaryAmountamount_contributed_previous_day=5;//Previousday's number of transactions through the Enhanced User Referral//Feature(s)forthisgiftcardprogram.(required)int32num_transactions_previous_day=6;//Informationaboutthemerchantthatinitiatedthecampaign.(required)MerchantInfomerchant_info=7;}
messageMerchantInfo{// Unique identifier for the merchant.// (recommended for Campaign feed, required for others)stringmerchant_id=1;// Name of the merchant that initiated the campaign.// (recommended for Campaign feed, required for others)stringmerchant_name=2;// Unstructured address of the merchant that initiated the gift card.// (optional)// E.g. "1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043"stringmerchant_address_unstructured=3;// Structured address of the merchant that initiated the gift card. (required)PostalAddressmerchant_postal_address=4;// Business category of the merchant, e.g. restaurant. (optional)// See https://developers.google.com/places/supported_types for possible// categories.stringmerchant_category=5;}
// The postal address for a merchant.messagePostalAddress{// The country, e.g. "US". (required)stringcountry=1;// The locality/city, e.g. "Mountain View". (required)stringlocality=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)stringregion=3;// The postal code, e.g. "94043". (required)stringpostal_code=4;// The street address, e.g. "1600 Amphitheatre Pkwy". (optional)stringstreet_address=5;}
Exemple de carte cadeau (au format JSON)
Dans l'exemple JSON ci-dessous, l'utilisateur peut acheter une carte cadeau Jetters Pizza active. Deux cartes cadeaux ont été vendues la veille, pour un total de 50 $ d'achats réalisés par les utilisateurs de Google. Outre ce fichier, un fichier descripteur doit également être importé sur le serveur SFTP générique, dans lequel la valeur "name" est définie sur "fundraising.giftcard". Pour en savoir plus sur l'utilisation de la référence du serveur SFTP générique, consultez ce tutoriel.
{"data":[{"gift_card_id":"1","gift_card_status":{"status":"ACTIVE"},"gift_card_url":"www.example.com/jetterspizza","data_retrieval_date":"2020-04-24","amount_contributed_previous_day":{"monetary_amount_centi":5000,"currency_code":"USD"},"num_of_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"}}]}
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/26 (UTC)."],[[["\u003cp\u003eMerchants can enable customers to purchase gift cards directly from their Google listing using provided links.\u003c/p\u003e\n"],["\u003cp\u003eA gift card feed facilitates data exchange, allowing platforms to send daily metrics on gift card performance to Google.\u003c/p\u003e\n"],["\u003cp\u003ePartners engaged in Small Business Fundraising utilize a Generic dropbox with a specific descriptor for gift card data uploads.\u003c/p\u003e\n"],["\u003cp\u003eThe provided proto specification and JSON sample guide the structure and format required for gift card data feeds.\u003c/p\u003e\n"],["\u003cp\u003eGift card data feeds should encompass all entries for the reporting date and include details such as gift card status, purchase URL, sales metrics, and merchant information.\u003c/p\u003e\n"]]],["Merchants can integrate gift card links into Google listings using a gift card feed. This feed, utilizing the Generic dropbox, reports daily gift card metrics, including the previous day's contributions and transaction counts. Each gift card entry must contain a unique ID, status (active/inactive), URL, data retrieval date, previous day's monetary contribution and number of transactions, and merchant information. Data is uploaded using a JSON format and descriptor file named 'fundraising.giftcard'. A tutorial on the Generic dropbox is provided.\n"],null,["# Gift Cards Feed\n\nMerchants will be able to add gift card purchasing links to their listing on Google. The gift cards feed is used for the gift card platform to send metrics on the previous days' results for all gift cards. The gift cards feed will utilize the Generic SFTP server with the 'name' value in the descriptor file being set to 'fundraising.giftcard'. For instruction on how to use the Generic SFTP server,\n[reference this tutorial](/actions-center/verticals?vertical_redirect_fragment=guides/tutorials/tutorial-generic-sftp).\nThe proto specificaton is available below as well as a sample JSON feed.\n| **Note:** This section is only applicable to partners completing a Small Business Fundraising integration. If you are unsure if you are participating in this project, please reach out to your Google business development contact.\n\nProto specification\n-------------------\n\nThe specification below is available in proto format. This is used to define all of the fields that are available in the feed. When uploading to the Generic SFTP server you are also able to use JSON formatting as demonstrated in the JSON sample.\n\n### Gift Card Feed Definition\n\n```text\nmessage GiftCardFeed {\n repeated GiftCard data = 1;\n}\n```\n\n### Gift Card Definition\n\n```gdscript\nmessage GiftCard {\n // Unique identifier for the gift card. (required)\n // (Note: could be the same as the gift card url if that's the only unique\n // identifier the partner uses. This will mainly be used for identification\n // when Google and partners communicate issues for a particular gift card\n // entry.)\n string gift_card_id = 1;\n\n // Whether this gift card entry is active (i.e. able to be purchased) or\n // inactive. (required)\n GiftCardStatus gift_card_status = 2;\n\n // The gift card url on the platform. (required)\n string gift_card_url = 3;\n\n // The date in YYYY-MM-DD format indicates when the\n // amount_contributed_previous_day and num_of_transactions_previous_day data\n // below are retrieved. Should always be one day after the date which the\n // stats in xxx_previous_day corresponds to. UTC timezone should be used to\n // delineate which transactions fall on which dates.\n // E.g. if the amount_contributed_previous_day corresponds to the amount\n // contributed yesterday, then the data_retrieval_date here should be set as\n // today's date. (required)\n // The feed must include all gift card entries for the given date (no partial\n // uploads). (required)\n string data_retrieval_date = 4;\n\n // Previous day's monetary amount contributed through the Enhanced User\n // Referral Feature(s) to this gift card program. (required)\n MonetaryAmount amount_contributed_previous_day = 5;\n\n // Previous day's number of transactions through the Enhanced User Referral\n // Feature(s) for this gift card program. (required)\n int32 num_transactions_previous_day = 6;\n\n // Information about the merchant that initiated the campaign. (required)\n MerchantInfo merchant_info = 7;\n}\n```\n\n### Gift Card Status Definition\n\n```gdscript\nmessage GiftCardStatus {\n enum Status {\n // Unused.\n STATUS_UNSPECIFIED = 0;\n\n // Able to be purchased.\n ACTIVE = 1;\n\n // Unable to be purchased.\n INACTIVE = 2;\n }\n\n Status status = 1;\n}\n```\n\n### Merchant Definition\n\n```carbon\nmessage MerchantInfo {\n // Unique identifier for the merchant.\n // (recommended for Campaign feed, required for others)\n string merchant_id = 1;\n\n // Name of the merchant that initiated the campaign.\n // (recommended for Campaign feed, required for others)\n string merchant_name = 2;\n\n // Unstructured address of the merchant that initiated the gift card.\n // (optional)\n // E.g. \"1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043\"\n string merchant_address_unstructured = 3;\n\n // Structured address of the merchant that initiated the gift card. (required)\n PostalAddress merchant_postal_address = 4;\n\n // Business category of the merchant, e.g. restaurant. (optional)\n // See https://developers.google.com/places/supported_types for possible\n // categories.\n string merchant_category = 5;\n}\n```\n\n### Monetary Amount Definition\n\n```css+lasso\nmessage MonetaryAmount {\n // The monetary amount in centi-units of the currency.\n // For example: 1.95 USD is 195 in centi-units.\n // If your amount contains fractions of the smallest currency unit, then it\n // will be rounded using nearest even rounding (e.g. 2.5 cents rounded\n // to 2 cents, 3.5 cents rounded to 4 cents, 0.5 cents rounded to 0 cents,\n // 2.51 cents rounded to 3 cents). (required)\n int64 monetary_amount_centi = 1;\n\n // The currency of the price that is defined in ISO 4217. (required)\n string currency_code = 2;\n}\n```\n\n### Postal Address Definition\n\n```carbon\n// The postal address for a merchant.\nmessage PostalAddress {\n // The country, e.g. \"US\". (required)\n string country = 1;\n\n // The locality/city, e.g. \"Mountain View\". (required)\n string locality = 2;\n\n // The region/state/province, e.g. \"CA\". This field is only required in\n // countries where region is commonly a part of the address. (optional)\n string region = 3;\n\n // The postal code, e.g. \"94043\". (required)\n string postal_code = 4;\n\n // The street address, e.g. \"1600 Amphitheatre Pkwy\". (optional)\n string street_address = 5;\n}\n```\n\nGift Card example (in JSON format)\n----------------------------------\n\nThe below JSON example has one active gift card available for sale for Jetters Pizza. There were two gift card sales the previous day for a total of $50.00 in sales from Google users. In addition to this file, a descriptor file would also need to be uploaded to the Generic SFTP server with the 'name' value in the descriptor file being set to 'fundraising.giftcard'. For more information on how to use the Generic SFTP server reference\n[this tutorial](/actions-center/verticals?vertical_redirect_fragment=guides/tutorials/tutorial-generic-sftp). \n\n```carbon\n{\n \"data\": [\n {\n \"gift_card_id\": \"1\",\n \"gift_card_status\": {\n \"status\": \"ACTIVE\"\n },\n \"gift_card_url\": \"www.example.com/jetterspizza\",\n \"data_retrieval_date\": \"2020-04-24\",\n \"amount_contributed_previous_day\": {\n \"monetary_amount_centi\": 5000,\n \"currency_code\": \"USD\"\n },\n \"num_of_transactions_previous_day\": 2,\n \"merchant_info\": {\n \"merchant_id\": \"A\",\n \"merchant_name\": \"Jetters Pizza\",\n \"merchant_address_unstructured\": \"1600 Amphitheatre Pkwy, Mountain View, CA, USA, 94043\",\n \"merchant_postal_address\": {\n \"country\": \"United States\",\n \"region\": \"CA\",\n \"postal_code\": \"94043\",\n \"street_address\": \"1600 Amphitheatre Pkwy\",\n \"locality\": \"Mountain View\"\n },\n \"merchant_category\": \"restaurant\"\n }\n }\n ]\n}\n```"]]