Analytics API
Importing historical visits
Learn how to backfill historical visits to the Analytics API
The Log visit endpoint supports backfilling historical visit data using the request_timestamp
parameter. This allows you to import past analytics data and maintain complete historical records in your analytics dashboard.
When logging visits, you can include an request_timestamp
field in your request to specify when the visit originally occurred. This timestamp will be used for analytics reporting instead of the time when the API receives the request.
If no request_timestamp
is provided, the server will automatically use the current time when the request is received.
Best practices
- Import historical data in chronological order when possible
- Include User-Agent strings and other headers from your historical data where available
- Consider rate limiting your import requests to avoid overwhelming the API
- Verify that imported data appears correctly in your analytics dashboard
Important considerations
- Historical imports will affect your analytics metrics and may change existing reports
- Ensure you have the necessary permissions and comply with data retention policies
- Consider the impact on your API rate limits when importing large volumes of historical data