Google Places Autocomplete (included with Places Details) SKU is not getting triggered while using session...












1















I am making requests to the Google places autocomplete and details api. For both I am using session tokens to use the autocomplete api charge free, but I don't see the Autocomplete (included with Places Details) SKU in the Google report. I started using it a week ago and all I see is the SKU: Autocomplete without Places Details – Per Session.



In my code I am generating a new version 4 UUID compliant session token after a request to the details api is made. I am following the guidelines in the docs that say this:



The workflow



So I am doing that exact thing. But I don't see the Autocomplete (included with Place Details) in the report. I am sure a lot of calls have been made. Any ideas why this is happening?



Note: Instead of placeid I am using place_id parameter for the details call which also works. I don't think that's the reason but anyways...



I am using this function to generate the session tokens:



var UUID = (function() {
var self = {};
var lut = ;
for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
self.generate = function() {
var d0 = Math.random()*0xffffffff|0;
var d1 = Math.random()*0xffffffff|0;
var d2 = Math.random()*0xffffffff|0;
var d3 = Math.random()*0xffffffff|0;
return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
}
return self;
})();


It outputs a string in a format like this: a28cf301-d8fd-4ebd-ac25-a94a37113b6c.



I am using a leaflet control to make the requests.



The following function is called each time a letter is typed:



// Places Autocomplete call
autocomplete: function(e) {
var mapCenter = this._map.getCenter();
var url = this.options.url + '/autocomplete?' +
'input=' + this.input.value + '&' +
'location=' + mapCenter.lat + ',' + mapCenter.lng;

if (this.options.useSessions) {
url += '&sessiontoken=' + this.sessionToken;
}

var geocoder = this;

$.get(url, function(data, status) {
if (data === undefined || data.status !== 'OK') {
return;
}

// Use predictions to populate a list
});
},


That function populates a list with the predictions and add click event listeners to each list item. When an item is clicked the following function is called.



// Place Details request
focusSelected: function(e) {
var url = this.options.url + '/details?' +
'place_id=' + e.target.place_id;

if (this.options.useSessions) {
url += '&sessiontoken=' + this.sessionToken;
this.sessionToken = UUID.generate(); // This creates a new token
}

var geocoder = this;
$.get(url, function(data, status) {
if (data === undefined || data.status !== 'OK') {
return;
}

// Use result

});
},


I am also setting the API key in each call. Don't mind about that.










share|improve this question





























    1















    I am making requests to the Google places autocomplete and details api. For both I am using session tokens to use the autocomplete api charge free, but I don't see the Autocomplete (included with Places Details) SKU in the Google report. I started using it a week ago and all I see is the SKU: Autocomplete without Places Details – Per Session.



    In my code I am generating a new version 4 UUID compliant session token after a request to the details api is made. I am following the guidelines in the docs that say this:



    The workflow



    So I am doing that exact thing. But I don't see the Autocomplete (included with Place Details) in the report. I am sure a lot of calls have been made. Any ideas why this is happening?



    Note: Instead of placeid I am using place_id parameter for the details call which also works. I don't think that's the reason but anyways...



    I am using this function to generate the session tokens:



    var UUID = (function() {
    var self = {};
    var lut = ;
    for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
    self.generate = function() {
    var d0 = Math.random()*0xffffffff|0;
    var d1 = Math.random()*0xffffffff|0;
    var d2 = Math.random()*0xffffffff|0;
    var d3 = Math.random()*0xffffffff|0;
    return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
    lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
    lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
    lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
    }
    return self;
    })();


    It outputs a string in a format like this: a28cf301-d8fd-4ebd-ac25-a94a37113b6c.



    I am using a leaflet control to make the requests.



    The following function is called each time a letter is typed:



    // Places Autocomplete call
    autocomplete: function(e) {
    var mapCenter = this._map.getCenter();
    var url = this.options.url + '/autocomplete?' +
    'input=' + this.input.value + '&' +
    'location=' + mapCenter.lat + ',' + mapCenter.lng;

    if (this.options.useSessions) {
    url += '&sessiontoken=' + this.sessionToken;
    }

    var geocoder = this;

    $.get(url, function(data, status) {
    if (data === undefined || data.status !== 'OK') {
    return;
    }

    // Use predictions to populate a list
    });
    },


    That function populates a list with the predictions and add click event listeners to each list item. When an item is clicked the following function is called.



    // Place Details request
    focusSelected: function(e) {
    var url = this.options.url + '/details?' +
    'place_id=' + e.target.place_id;

    if (this.options.useSessions) {
    url += '&sessiontoken=' + this.sessionToken;
    this.sessionToken = UUID.generate(); // This creates a new token
    }

    var geocoder = this;
    $.get(url, function(data, status) {
    if (data === undefined || data.status !== 'OK') {
    return;
    }

    // Use result

    });
    },


    I am also setting the API key in each call. Don't mind about that.










    share|improve this question



























      1












      1








      1








      I am making requests to the Google places autocomplete and details api. For both I am using session tokens to use the autocomplete api charge free, but I don't see the Autocomplete (included with Places Details) SKU in the Google report. I started using it a week ago and all I see is the SKU: Autocomplete without Places Details – Per Session.



      In my code I am generating a new version 4 UUID compliant session token after a request to the details api is made. I am following the guidelines in the docs that say this:



      The workflow



      So I am doing that exact thing. But I don't see the Autocomplete (included with Place Details) in the report. I am sure a lot of calls have been made. Any ideas why this is happening?



      Note: Instead of placeid I am using place_id parameter for the details call which also works. I don't think that's the reason but anyways...



      I am using this function to generate the session tokens:



      var UUID = (function() {
      var self = {};
      var lut = ;
      for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
      self.generate = function() {
      var d0 = Math.random()*0xffffffff|0;
      var d1 = Math.random()*0xffffffff|0;
      var d2 = Math.random()*0xffffffff|0;
      var d3 = Math.random()*0xffffffff|0;
      return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
      lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
      lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
      lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
      }
      return self;
      })();


      It outputs a string in a format like this: a28cf301-d8fd-4ebd-ac25-a94a37113b6c.



      I am using a leaflet control to make the requests.



      The following function is called each time a letter is typed:



      // Places Autocomplete call
      autocomplete: function(e) {
      var mapCenter = this._map.getCenter();
      var url = this.options.url + '/autocomplete?' +
      'input=' + this.input.value + '&' +
      'location=' + mapCenter.lat + ',' + mapCenter.lng;

      if (this.options.useSessions) {
      url += '&sessiontoken=' + this.sessionToken;
      }

      var geocoder = this;

      $.get(url, function(data, status) {
      if (data === undefined || data.status !== 'OK') {
      return;
      }

      // Use predictions to populate a list
      });
      },


      That function populates a list with the predictions and add click event listeners to each list item. When an item is clicked the following function is called.



      // Place Details request
      focusSelected: function(e) {
      var url = this.options.url + '/details?' +
      'place_id=' + e.target.place_id;

      if (this.options.useSessions) {
      url += '&sessiontoken=' + this.sessionToken;
      this.sessionToken = UUID.generate(); // This creates a new token
      }

      var geocoder = this;
      $.get(url, function(data, status) {
      if (data === undefined || data.status !== 'OK') {
      return;
      }

      // Use result

      });
      },


      I am also setting the API key in each call. Don't mind about that.










      share|improve this question
















      I am making requests to the Google places autocomplete and details api. For both I am using session tokens to use the autocomplete api charge free, but I don't see the Autocomplete (included with Places Details) SKU in the Google report. I started using it a week ago and all I see is the SKU: Autocomplete without Places Details – Per Session.



      In my code I am generating a new version 4 UUID compliant session token after a request to the details api is made. I am following the guidelines in the docs that say this:



      The workflow



      So I am doing that exact thing. But I don't see the Autocomplete (included with Place Details) in the report. I am sure a lot of calls have been made. Any ideas why this is happening?



      Note: Instead of placeid I am using place_id parameter for the details call which also works. I don't think that's the reason but anyways...



      I am using this function to generate the session tokens:



      var UUID = (function() {
      var self = {};
      var lut = ;
      for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
      self.generate = function() {
      var d0 = Math.random()*0xffffffff|0;
      var d1 = Math.random()*0xffffffff|0;
      var d2 = Math.random()*0xffffffff|0;
      var d3 = Math.random()*0xffffffff|0;
      return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
      lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
      lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
      lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
      }
      return self;
      })();


      It outputs a string in a format like this: a28cf301-d8fd-4ebd-ac25-a94a37113b6c.



      I am using a leaflet control to make the requests.



      The following function is called each time a letter is typed:



      // Places Autocomplete call
      autocomplete: function(e) {
      var mapCenter = this._map.getCenter();
      var url = this.options.url + '/autocomplete?' +
      'input=' + this.input.value + '&' +
      'location=' + mapCenter.lat + ',' + mapCenter.lng;

      if (this.options.useSessions) {
      url += '&sessiontoken=' + this.sessionToken;
      }

      var geocoder = this;

      $.get(url, function(data, status) {
      if (data === undefined || data.status !== 'OK') {
      return;
      }

      // Use predictions to populate a list
      });
      },


      That function populates a list with the predictions and add click event listeners to each list item. When an item is clicked the following function is called.



      // Place Details request
      focusSelected: function(e) {
      var url = this.options.url + '/details?' +
      'place_id=' + e.target.place_id;

      if (this.options.useSessions) {
      url += '&sessiontoken=' + this.sessionToken;
      this.sessionToken = UUID.generate(); // This creates a new token
      }

      var geocoder = this;
      $.get(url, function(data, status) {
      if (data === undefined || data.status !== 'OK') {
      return;
      }

      // Use result

      });
      },


      I am also setting the API key in each call. Don't mind about that.







      web-services google-places-api






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 9 '18 at 4:47







      Michael

















      asked Nov 16 '18 at 21:45









      MichaelMichael

      3351517




      3351517
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You will see Autocomplete without Places Details – Per Session if you don't complete a Places Details request within a few minutes of starting the session.



          Documentation



          https://developers.google.com/maps/billing/understanding-cost-of-use#ac-no-details-session






          share|improve this answer
























          • There are a lot of times I am doing a place details request after several autocomplete requests.

            – Michael
            Dec 9 '18 at 3:59











          • Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

            – AnonymousSB
            Dec 9 '18 at 4:00











          • I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

            – Michael
            Dec 9 '18 at 4:04








          • 1





            Could you update your question with your code?

            – AnonymousSB
            Dec 9 '18 at 4:08











          • I added some code. Let me know if you need anything else

            – Michael
            Dec 9 '18 at 4:49











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345848%2fgoogle-places-autocomplete-included-with-places-details-sku-is-not-getting-tri%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You will see Autocomplete without Places Details – Per Session if you don't complete a Places Details request within a few minutes of starting the session.



          Documentation



          https://developers.google.com/maps/billing/understanding-cost-of-use#ac-no-details-session






          share|improve this answer
























          • There are a lot of times I am doing a place details request after several autocomplete requests.

            – Michael
            Dec 9 '18 at 3:59











          • Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

            – AnonymousSB
            Dec 9 '18 at 4:00











          • I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

            – Michael
            Dec 9 '18 at 4:04








          • 1





            Could you update your question with your code?

            – AnonymousSB
            Dec 9 '18 at 4:08











          • I added some code. Let me know if you need anything else

            – Michael
            Dec 9 '18 at 4:49
















          0














          You will see Autocomplete without Places Details – Per Session if you don't complete a Places Details request within a few minutes of starting the session.



          Documentation



          https://developers.google.com/maps/billing/understanding-cost-of-use#ac-no-details-session






          share|improve this answer
























          • There are a lot of times I am doing a place details request after several autocomplete requests.

            – Michael
            Dec 9 '18 at 3:59











          • Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

            – AnonymousSB
            Dec 9 '18 at 4:00











          • I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

            – Michael
            Dec 9 '18 at 4:04








          • 1





            Could you update your question with your code?

            – AnonymousSB
            Dec 9 '18 at 4:08











          • I added some code. Let me know if you need anything else

            – Michael
            Dec 9 '18 at 4:49














          0












          0








          0







          You will see Autocomplete without Places Details – Per Session if you don't complete a Places Details request within a few minutes of starting the session.



          Documentation



          https://developers.google.com/maps/billing/understanding-cost-of-use#ac-no-details-session






          share|improve this answer













          You will see Autocomplete without Places Details – Per Session if you don't complete a Places Details request within a few minutes of starting the session.



          Documentation



          https://developers.google.com/maps/billing/understanding-cost-of-use#ac-no-details-session







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 9 '18 at 1:07









          AnonymousSBAnonymousSB

          2,184221




          2,184221













          • There are a lot of times I am doing a place details request after several autocomplete requests.

            – Michael
            Dec 9 '18 at 3:59











          • Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

            – AnonymousSB
            Dec 9 '18 at 4:00











          • I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

            – Michael
            Dec 9 '18 at 4:04








          • 1





            Could you update your question with your code?

            – AnonymousSB
            Dec 9 '18 at 4:08











          • I added some code. Let me know if you need anything else

            – Michael
            Dec 9 '18 at 4:49



















          • There are a lot of times I am doing a place details request after several autocomplete requests.

            – Michael
            Dec 9 '18 at 3:59











          • Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

            – AnonymousSB
            Dec 9 '18 at 4:00











          • I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

            – Michael
            Dec 9 '18 at 4:04








          • 1





            Could you update your question with your code?

            – AnonymousSB
            Dec 9 '18 at 4:08











          • I added some code. Let me know if you need anything else

            – Michael
            Dec 9 '18 at 4:49

















          There are a lot of times I am doing a place details request after several autocomplete requests.

          – Michael
          Dec 9 '18 at 3:59





          There are a lot of times I am doing a place details request after several autocomplete requests.

          – Michael
          Dec 9 '18 at 3:59













          Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

          – AnonymousSB
          Dec 9 '18 at 4:00





          Are you making sure to use the same session id for all requests? Or are you generating a new session id per?

          – AnonymousSB
          Dec 9 '18 at 4:00













          I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

          – Michael
          Dec 9 '18 at 4:04







          I use only one token at a time. I do several autocomplete requests with token ABC, then one place details with the same token ABC. Each time I am done with a place details request I generate a new session token for the next autocomplete or details requests.

          – Michael
          Dec 9 '18 at 4:04






          1




          1





          Could you update your question with your code?

          – AnonymousSB
          Dec 9 '18 at 4:08





          Could you update your question with your code?

          – AnonymousSB
          Dec 9 '18 at 4:08













          I added some code. Let me know if you need anything else

          – Michael
          Dec 9 '18 at 4:49





          I added some code. Let me know if you need anything else

          – Michael
          Dec 9 '18 at 4:49


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345848%2fgoogle-places-autocomplete-included-with-places-details-sku-is-not-getting-tri%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini