Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Siguiente js AMP amp-onetap-google no funciona

Estoy tratando de agregar google con un toque en mi próxima página de js amp. La implementación se basa en un enfoque de iframe intermedio basado en este documento https://developers.google.com/identity/gsi/web/amp/intermediate-iframe

este es el codigo

Página Iframe intermedia alojada

 /pages/amp-gtap-iframe.js function AmpGtapIframe(props) { // logic to initialize google gsi , not sure if this is needed but even with this the AMP page one tap does not work const handleGoogleLogin = async (response) => { //logic to handle login }; const initializeGSI = () => { google.accounts.id.initialize({ client_id: GOOGLE_CLIENT_ID, cancel_on_tap_outside: false, callback: handleGoogleLogin, }); }; useEffect(() => { const el = document.createElement('script'); el.setAttribute('src', 'https://accounts.google.com/gsi/client'); el.onload = () => initializeGSI(); document.querySelector('body').appendChild(el); }, []); ///////// return ( <div id="g_id_onload" data-client_id="YOUR_GOOGLE_CLIENT_ID" data-allowed_parent_origin="https://example.com"> </div> ); } export async function getStaticProps(context) { return { props: {}, }; } export default AmpGtapIframe;

La próxima página de js amp

 /pages/amp-page.js export const config = { amp: true, }; function AmpPage(props) { return ( <div> <amp-onetap-google layout="nodisplay" data-src="https://example.com/amp-gtap-iframe" ></amp-onetap-google> </div> ); } export async function getStaticProps(context) { return { props: {}, }; } export default AmpPage;

Cuando voy a example.com/amp-page, obtengo un iframe pero las identificaciones de correo electrónico registradas en Google no se procesan

No estoy seguro de lo que hice mal, o mi comprensión de la implementación es incorrecta, cualquier ayuda es muy apreciada, gracias de antemano.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!