code: def generate_image_beacon(self, event_collection, event_body, timestamp=None):
          
          event = Event(self.project_id, event_collection, event_body,
                        timestamp=timestamp)
          event_json = event.to_json()
          return "{0}/{1}/projects/{2}/events/{3}?api_key={4}&data={5}".format(
              self.api.base_url, self.api.api_version, self.project_id, self._url_escape(event_collection),
              self.api.write_key.decode(sys.getdefaultencoding()), self._base64_encode(event_json)
          )
docs: Generates an image beacon URL.
  
          :param event_collection: the name of the collection to insert the
          event to
          :param event_body: dict, the body of the event to insert the event to
          :param timestamp: datetime, optional, the timestamp of the event