title: how to call getBasicProfile() of google to google signin on only button click?
body: <p>i have take google signin in my website :</p>
  
  <p></p>
  
  <pre><code>&lt;script src="https://apis.google.com/js/platform.js" async defer&gt;&lt;/script&gt;
  
  &lt;script&gt;
      function onSignIn(googleUser) {
        var profile = googleUser.getBasicProfile();
        //console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
        //console.log('Image URL: ' + profile.getImageUrl());
        //console.log('Name: ' + profile.getName());
        //console.log('Email: ' + profile.getEmail());
        var user_uname = profile.getName();
        var user_email = profile.getEmail();
        alert(user_uname);
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and here is a button to login google:</p>
  
  <pre><code>&lt;div class="g-signin2" data-onsuccess="onSignIn"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>i want to give user google signin but the problem is whenever page is load onSignIn() function is called automatically.
  i want it only on button click. can anybody help me?</p>