title: Google Analytics Embed Api with new google login authorization flow -i.e Google Identity ( 2022 )
body: <p>I have been trying to integrate google analytics embed api in my react application by using traditional gapi approach but I am getting this error from google</p>
  <blockquote>
  <p>&quot;You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the <a href="https://developers.google.com/identity/gsi/web/guides/gis-migration" rel="nofollow noreferrer">Migration Guide</a> for more information.&quot;</p>
  </blockquote>
  <p>I get it that newly created client ids won't work with gapi as mentioned here <a href="https://developers.google.com/identity/sign-in/web/sign-in" rel="nofollow noreferrer">https://developers.google.com/identity/sign-in/web/sign-in</a></p>
  <blockquote>
  <p>We are discontinuing the Google Sign-In JavaScript Platform Library for web. The library will be unavailable for download after the March 31, 2023 deprecation date. Instead, use the new Google Identity Services for Web.
  By default, newly created Client IDs are now blocked from using the older Platform Library, existing Client IDs are unaffected. New Client IDs created before July 29th, 2022 can set <code>plugin_name</code> to enable use of the Google Platform Library.</p>
  </blockquote>
  <p>I have also tried to add <strong>plugin_name</strong> but it stills gives the same error . I have also tried this package <a href="https://www.npmjs.com/package/react-use-analytics-api" rel="nofollow noreferrer">https://www.npmjs.com/package/react-use-analytics-api</a> but it also uses gapi so it is outdated as well ( but works with old client ids ).
  Here is the react-use-analytics-api code I have followed <a href="https://justinmahar.github.io/react-use-analytics-api/useAuthorize" rel="nofollow noreferrer">https://justinmahar.github.io/react-use-analytics-api/useAuthorize</a></p>
  <p>Now my question is how can I integrate google analytics embed api in my react project with new google authorization flow that is Google Identity .</p>