L'API Search Ads 360 Reporting precedente è stata ritirata. Ora puoi creare i report utilizzando la nuova API Search Ads 360 Reporting.
Tieni presente che i metodi get e getByCustomerId nell'API Search Ads 360 Conversion verranno ritirati nel terzo trimestre del 2025. Per continuare ad accedere ai dati sulle conversioni, devi creare un report utilizzando la risorsa conversion con la nuova API Search Ads 360 Reporting. Scopri di più qui.
Le restanti funzioni dell'API Search Ads 360 Conversion continueranno a essere supportate.
La tua prima app: prerequisiti
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Prima di poter iniziare a scrivere la tua prima applicazione client, se non l'hai ancora fatto, devi completare alcune operazioni.
Creare un Account Google e ottenere le autorizzazioni di Search Ads 360
Per utilizzare l'API Search Ads 360, devi disporre di un Account Google e delle autorizzazioni appropriate
concesse all'account da Search Ads 360:
Se non hai ancora un Account Google,
creane uno.
Chiedi a un gestore agenzia di Search Ads 360 di
creare un utente Search Ads 360 per il tuo Account Google.
Per scaricare i report, devi disporre dell'autorizzazione di visualizzazione per gli inserzionisti con cui lavorerai.
Per aggiungere o modificare le conversioni, devi disporre dell'autorizzazione di modifica per gli inserzionisti con cui collaborerai. In una
configurazione Floodlight condivisa,
devi disporre dell'autorizzazione di modifica per ogni inserzionista secondario in cui vuoi caricare le conversioni.
Non occorre l'accesso all'inserzionista principale né a quelli secondari in cui non stai caricando le conversioni. Se utilizzi gli ID clic per
attribuire
le conversioni alle visite, assicurati di disporre dell'accesso in modifica all'inserzionista che ha generato
l'ID clic. Se specifichi un ID clic da un inserzionista a cui non hai accesso in modifica,
la richiesta non andrà a buon fine.
Il Gestore agenzia può impostare il tuo account come Utente inserzionista con
accesso a inserzionisti specifici
oppure configurare il tuo account con un livello di accesso superiore, ad esempio Utente agenzia
con accesso a tutti gli inserzionisti dell'agenzia.
Attivare il servizio API Conversion
Se vuoi caricare i dati sulle conversioni, un utente Search Ads 360 con i privilegi di gestore agenzia deve accedere all'interfaccia utente di Search Ads 360 e attivare il servizio API Conversion. Per istruzioni, consulta il Centro assistenza Search Ads 360.
Crea un progetto nella console API di Google e le credenziali OAuth per il tuo client
- Avvia lo
strumento di configurazione della console API di Google.
Lo strumento di configurazione ti guiderà nella creazione di un progetto (o nell'utilizzo di un progetto esistente),
nell'attivazione dell'API Search Ads 360 e nella creazione delle credenziali OAuth 2.0.
- Nella pagina Registra la tua applicazione, seleziona un progetto esistente o Crea un progetto. Poi fai clic su Continua.
- Dopo che la console API di Google ha attivato l'API Search Ads 360, fai clic sul pulsante
Vai alle credenziali.
- Nella pagina Crea credenziali, inserisci le informazioni seguenti:
-
Quale API stai utilizzando?: API di Search Ads 360
-
A quali dati accederai?: Dati utente
- Fai clic sul pulsante Avanti.
Ora lo strumento di configurazione ti offre la possibilità di creare un ID client OAuth 2.0.
- Segui il resto della procedura nello strumento di configurazione.
Installa sa360Api.py
Search Ads 360 fornisce uno script di utilità per semplificare il processo di configurazione delle autorizzazioni. Puoi anche utilizzare questo script per inviare e ricevere dati in formato JSON,
se vuoi provare a inviare e ricevere dati prima di progettare e scrivere un'applicazione completa. Puoi copiare molti degli esempi JSON in questo sito di documentazione e inserirli direttamente nello script.
Per installare lo script:
- Installa Python 2.7.
Lo script non funziona con Python 3.x.
- Installa cURL.
- Scarica sa360Api.zip.
- Estrai
sa360Api.py
da sa360Api.zip
.
- Rendi
sa360Api.py
eseguibile.
Apprendere le nozioni di base di REST
Esistono due modi per richiamare l'API:
- Utilizzare le librerie client.
- Inviare richieste HTTP e analizzarne le risposte.
Se decidi di non utilizzare le librerie client, dovrai conoscere le nozioni di base di
REST.
REST è un tipo di architettura software che fornisce un approccio pratico e coerente per la richiesta e la modifica dei dati.
Il termine REST è l'acronimo di "REpresentational State Transfer". Nel contesto delle API di Google, si riferisce all'utilizzo dei verbi HTTP per recuperare e modificare le rappresentazioni dei dati archiviati da Google.
In un sistema RESTful, le risorse vengono archiviate in un datastore. Un client invia una richiesta affinché il server esegua una determinata azione (ad esempio la creazione, il recupero, l'aggiornamento o l'eliminazione di una risorsa) e il server esegue l'azione e invia una risposta, spesso sotto forma di rappresentazione della risorsa specificata.
Nelle API RESTful di Google, il client specifica un'azione mediante un verbo HTTP come POST
, GET
, PUT
o DELETE
. La risorsa viene specificata tramite un URI globalmente univoco con il seguente formato:
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
Poiché tutte le risorse dell'API dispongono di URI univoci accessibili tramite HTTP, REST consente la memorizzazione dei dati nella cache ed è ottimizzato per operare con l'infrastruttura distribuita del Web.
Potresti trovare utili le definizioni dei metodi nella documentazione degli standard HTTP 1.1, che include le specifiche per GET
, POST
, PUT
e DELETE
.
REST nell'API Search Ads 360
Le operazioni dell'API Search Ads 360 vengono mappate direttamente ai verbi HTTP REST.
Il formato specifico per gli URI dell'API Search Ads 360 è:
https://www.googleapis.com/doubleclicksearch/v2/resourcePath?parameters
L'insieme completo di URI utilizzati per ogni operazione supportata nell'API è descritto nel riferimento all'API.
Apprendere le nozioni di base di JSON
Se utilizzi REST, dovrai usare il formato JSON per il corpo delle richieste. Puoi
specificare che le risposte siano in formato JSON o CSV.
JSON (JavaScript Object Notation) è un formato di dati comune, indipendente dal linguaggio, che fornisce una semplice rappresentazione testuale di strutture di dati arbitrarie. Per ulteriori informazioni, visita il sito json.org.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-11-07 UTC.
[null,null,["Ultimo aggiornamento 2024-11-07 UTC."],[[["\u003cp\u003eBefore using the Search Ads 360 API, ensure you have a Google Account with the necessary Search Ads 360 permissions, which may include view or edit access to specific advertisers.\u003c/p\u003e\n"],["\u003cp\u003eTo upload conversion data, the API Conversion Service must be activated by a Search Ads 360 user with Agency Manager privileges.\u003c/p\u003e\n"],["\u003cp\u003eSet up a Google API Console project and obtain OAuth credentials for your client application to authenticate and authorize API access.\u003c/p\u003e\n"],["\u003cp\u003eInstall the provided \u003ccode\u003esa360Api.py\u003c/code\u003e utility script and familiarize yourself with REST and JSON basics if you plan to interact with the API directly without client libraries.\u003c/p\u003e\n"]]],["To start coding, create a Google Account and request Search Ads 360 permissions from an Agency Manager, who will grant view or edit access to advertisers. Activate the API conversion service via the Search Ads 360 UI. Next, create a Google API Console project and OAuth 2.0 credentials. Install Python 2.7, cURL, and the `sa360Api.py` utility script. Finally, understand REST basics and JSON formatting, crucial for interacting with the API using HTTP requests.\n"],null,["# Your First App: Prerequisites\n\nBefore you can start coding your first client application, there are a few things you\nneed to do, if you haven't done them already.\n\nCreate a Google Account and get Search Ads 360 permissions\n----------------------------------------------------------\n\nTo use the Search Ads 360 API, you need a Google Account and appropriate permissions\ngranted to that account from Search Ads 360:\n\n1. If you don't already have a Google Account, [create one](https://support.google.com/accounts/answer/27441).\n\n2. Ask a Search Ads 360 **Agency Manager** to [create a Search Ads 360 user](https://support.google.com/searchads/answer/6051717) for your Google Account.\n\n To download reports, you'll need **view permission** for the advertisers\n you'll be working with.\n\n To add or edit conversions, you'll need **edit permission** for the advertisers\n you'll be working with. In a\n [shared Floodlight configuration](https://support.google.com/searchads/answer/2458167),\n you need edit permission for each child advertiser you want to upload conversions into.\n You don't need access to the parent advertiser, nor do you need access to child advertisers\n that you're not uploading conversions into. If you use click IDs to\n [attribute\n conversions to visits](/search-ads/v2/how-tos/conversions/insert#attribute-a-conversion-to-a-specific-visit), make sure you have edit access to the advertiser that generated\n the click ID. If you specify a click ID from an advertiser you don't have edit access to,\n the request will not succeed.\n\n The Agency Manager can set up your account as an **Advertiser user** with\n access to specific advertisers,\n or set up your account with a higher level of access such as **Agency user**\n with access to all advertisers in the agency.\n\nActivate the API Conversion Service\n-----------------------------------\n\n\nIf you want to upload data about conversions, a Search Ads 360 user with **Agency\nManager** privileges needs to sign in to the Search Ads 360 UI and\n**activate the API conversion service** . See the\n[Search Ads 360\nhelp center](https://support.google.com/searchads/answer/2604604#activate) for instructions.\n\nCreate a Google API Console project and OAuth credentials for your client\n-------------------------------------------------------------------------\n\n1. Start the Google API Console [setup tool](https://console.cloud.google.com/start/api?id=doubleclicksearch&credential=client_key). \n The setup tool guides you through creating a project (or using an existing project), enabling the Search Ads 360 API, and creating OAuth 2.0 credentials.\n2. On the **Register your application** page, select an existing project or select **Create a project** . Then click **Continue**.\n3. After the Google API Console enables the Search Ads 360 API, click the **Go to credentials** button.\n4. On the **Create credentials** page, enter the following information:\n - **Which API are you using?**: Search Ads 360 API\n - **What data will you be accessing?**: User data\n5. Click the **Next** button.\n\n The setup tool now offers to help you create an **OAuth 2.0 client ID**.\n6. Follow the rest of the steps in the setup tool.\n\nInstall sa360Api.py\n-------------------\n\nSearch Ads 360 provides a utility script to facilitate the process of setting up\nauthorization. You can also use this script to send and receive data in the JSON format,\nif you want to try sending and receiving data before you design and write a full\napplication. You can copy many of the JSON examples in this documentation site and input\nthem directly to the script.\n\nTo install the script:\n\n1. [Install Python](http://www.python.org/getit/) 2.7. \n The script does not work with Python 3.x.\n2. [Install cURL](http://curl.haxx.se/download.html).\n3. [Download sa360Api.zip](https://www.google.com/help/hc/downloads/sa360/sa360Api.zip).\n4. Extract `sa360Api.py` from `sa360Api.zip`.\n5. Make `sa360Api.py` executable.\n\nLearn REST basics\n-----------------\n\nThere are two ways to invoke the API:\n\n- Using [client libraries](/search-ads/v2/libraries).\n- Sending HTTP requests and parsing the responses.\n\nIf you decide not to use client libraries, you'll need to understand the basics of\nREST.\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\n### REST in the Search Ads 360 API\n\nThe Search Ads 360 API operations map directly to REST HTTP verbs.\n\nThe specific format for Search Ads 360 API URIs is: \n\n```\nhttps://www.googleapis.com/doubleclicksearch/v2/resourcePath?parameters\n```\n\n\nThe full set of URIs used for each supported operation in the API is summarized in the [API Reference](/search-ads/v2/reference).\n\nLearn JSON basics\n-----------------\n\nIf you use REST, you'll need to use the JSON format for the request bodies. You can\nspecify that the responses be either in the JSON or CSV format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]