Aktualisiert ein Google Tag Manager-Konto. Probieren Sie es aus oder sehen Sie sich ein Beispiel an.
Anfragen
HTTP-Anfrage
PUT https://www.googleapis.com/tagmanager/v1/accounts/accountId
Parameter
Parametername | Wert | Beschreibung |
---|---|---|
Pfadparameter | ||
accountId |
string |
Die Google Tag Manager-Konto-ID. |
Optionale Abfrageparameter | ||
fingerprint |
string |
Wenn dieser Fingerabdruck angegeben wird, muss er mit dem Fingerabdruck des gespeicherten Kontos übereinstimmen. |
Autorisierung
Für diese Anfrage ist eine Autorisierung in folgendem Bereich erforderlich. Weitere Informationen zur Authentifizierung und Autorisierung
Umfang |
---|
https://www.googleapis.com/auth/tagmanager.manage.accounts |
Anfragetext
Geben Sie im Anfragetext eine Ressource vom Typ "Accounts" mit den folgenden Eigenschaften an:
Property-Name | Wert | Beschreibung | Hinweise |
---|---|---|---|
Optionale Attribute | |||
name |
string |
Anzeigename des Kontos. | Bearbeitbar |
shareData |
boolean |
Gibt an, ob über das Konto Daten anonym an Google und andere weitergegeben werden. | Bearbeitbar |
Antwort
Wenn der Vorgang erfolgreich ist, wird mit dieser Methode eine Ressource vom Typ Accounts im Antworttext zurückgegeben.
Beispiele
Hinweis: Bei den für diese Methode verfügbaren Codebeispielen sind nicht alle unterstützten Programmiersprachen vertreten. Eine Liste der unterstützten Sprachen finden Sie auf der Seite für Clientbibliotheken.
Java
Verwendet die Java-Clientbibliothek.
/* * Note: This code assumes you have an authorized tagmanager service object. */ /* * This request updates an existing account for the authorized user. */ // Construct the account object Account account = new Account(); account.setName("Primary GTM Account"); account.setShareData(false); try { Account response = tagmanager.accounts().update("123456", account).execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); } /* * The results of the update method are stored in the response object. * The following code shows how to access the updated name and fingerprint. */ System.out.println("Updated Name = " + response.getName()); System.out.println("Updated Fingerprint = " + response.getFingerprint());
Python
Verwendet die Python-Clientbibliothek.
# Note: This code assumes you have an authorized tagmanager service object. # This request updates an existing account for the authorized user. try: response = tagmanager.accounts().update( accountId='123456', body={ 'name': 'Primary GTM Account', 'shareData': False } ).execute() except TypeError, error: # Handle errors in constructing a query. print 'There was an error in constructing your query : %s' % error except HttpError, error: # Handle API errors. print ('There was an API error : %s : %s' % (error.resp.status, error.resp.reason)) # The results of the update method are stored in the response object. # The following code shows how to access the updated name and fingerprint. print 'Updated Name = %s' % response.get('name') print 'Updated Fingerprint = %s' % response.get('fingerprint')
Jetzt testen
Verwenden Sie den unten angegebenen APIs Explorer, um diese Methode für Livedaten aufzurufen und die Antwort einzusehen.