0.0.20240520 • Published 29 days ago

@maxim_mazurok/gapi.client.marketingplatformadmin-v1alpha v0.0.20240520

Weekly downloads
-
License
MIT
Repository
github
Last release
29 days ago

TypeScript typings for Google Marketing Platform Admin API v1alpha

The Google Marketing Platform Admin API allows for programmatic access to the Google Marketing Platform configuration data. You can use the Google Marketing Platform Admin API to manage links between your Google Marketing Platform organization and Google Analytics accounts, set the service level of your GA4 properties. For detailed description please check documentation.

Installing

Install typings for Google Marketing Platform Admin API:

npm install @types/gapi.client.marketingplatformadmin-v1alpha --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://marketingplatformadmin.googleapis.com/$discovery/rest?version=v1alpha',
  () => {
    // now we can use:
    // gapi.client.marketingplatformadmin
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('marketingplatformadmin', 'v1alpha', () => {
  // now we can use:
  // gapi.client.marketingplatformadmin
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // View your Google Analytics product account data in GMP home
    'https://www.googleapis.com/auth/marketingplatformadmin.analytics.read',

    // Manage your Google Analytics product account data in GMP home
    'https://www.googleapis.com/auth/marketingplatformadmin.analytics.update',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Google Marketing Platform Admin API resources:

/*
Lookup for a single organization.
*/
await gapi.client.marketingplatformadmin.organizations.get({name: 'name'});
0.0.20240520

29 days ago

0.0.20240516

1 month ago

0.0.20240515

1 month ago

0.0.20240514

1 month ago

0.0.20240513

1 month ago

0.0.20240509

1 month ago

0.0.20240508

1 month ago

0.0.20240507

1 month ago

0.0.20240506

1 month ago

0.0.20240502

2 months ago

0.0.20240501

2 months ago

0.0.20240430

2 months ago

0.0.20240429

2 months ago

0.0.20240425

2 months ago

0.0.20240424

2 months ago

0.0.20240423

2 months ago

0.0.20240422

2 months ago

0.0.20240418

2 months ago

0.0.20240416

2 months ago

0.0.20240415

2 months ago

0.0.20240411

2 months ago

0.0.20240410

2 months ago

0.0.20240409

2 months ago

0.0.20240408

2 months ago

0.0.20240404

2 months ago

0.0.20240403

3 months ago

0.0.20240401

3 months ago

0.0.20240402

3 months ago

0.0.20240328

3 months ago

0.0.20240327

3 months ago

0.0.20240326

3 months ago

0.0.20240325

3 months ago

0.0.20240321

3 months ago

0.0.20240320

3 months ago

0.0.20240319

3 months ago

0.0.20240318

3 months ago

0.0.20240314

3 months ago

0.0.20240311

3 months ago

0.0.20240312

3 months ago

0.0.20240313

3 months ago

0.0.20240307

3 months ago

0.0.20240306

3 months ago

0.0.20240304

4 months ago

0.0.20240229

4 months ago