def analytics(self, resource_type, username, id=None, start=None, end=None):
        """Returns the request counts per day for a given resource and period.
        
        Parameters
        ----------
        resource_type : str
            The resource being requested.
            
            Possible values are "tokens", "styles", "tilesets", and "accounts".
        
        username : str
            The username for the account that owns the resource.
            
        id : str, optional
            The id for the resource.
            
            If resource_type is "tokens", then id is the complete token.
            If resource_type is "styles", then id is the style id.
            If resource_type is "tilesets", then id is a map id.
            If resource_type is "accounts", then id is not required.
        
        start, end : str, optional
            ISO-formatted start and end dates.
            
            If provided, the start date must be earlier than the end date, 
            and the maximum length of time between the start and end dates 
            is one year.
            
            If not provided, the length of time between the start and end 
            dates defaults to 90 days.
        
        Returns
        -------
        requests.Response
        """
        
        resource_type = self._validate_resource_type(resource_type)
        username = self._validate_username(username)
        start, end = self._validate_period(start, end)
        id = self._validate_id(resource_type, id)

        params = {}
        if id is not None:
            params.update({'id': id})

        if start is not None and end is not None:
            params.update({'period': start + ',' + end})

        uri = URITemplate(self.baseuri + '/{resourceType}/{username}').expand(
            resourceType=resource_type, username=username)

        resp = self.session.get(uri, params=params)
        resp.geojson = resp.json()
        self.handle_http_error(resp)

        return resp