[Maps API] The workaround of Biling Tags for Maps API for JavaScript

You want to track the number of function calls to different HERE services in your app using the HERE Maps JavaScript API.

###

### Current Limitation: No Native Billing Tags in JS API

The HERE Maps JavaScript API does not support custom billing tags per API call like the REST API does.

###

### Recommended Workaround: Internal Tagging via Wrapper Functions

To achieve per-function and per-service tracking, you can implement custom wrapper functions around HERE API calls. Here's how:

#### 1. Wrap Each HERE API Call

Create a wrapper for each HERE service call (e.g., map rendering, geocoding, routing) and log metadata such as:

Function name
Environment (prod/dev)
Timestamp
Feature used (maps, routing, etc.)
* Optional internal tag (e.g., billingTag: "maps-prod")

<br />function trackUsage(serviceName, feature, environment) { console.log(`[${new Date().toISOString()}] ${serviceName} - ${feature} - ${environment}`); // Optionally send this to your internal analytics or logging service}function callGeocodingService(params) { trackUsage("HERE Geocoding", "geocode", "prod"); // Actual HERE API call here}<br />

#### 2. Use a Centralized Logging System

Send these logs to a centralized system (e.g., ELK stack, Datadog, or even Google Sheets via Apps Script) to generate monthly reports for finance and budgeting.

#### 3. Reconcile with HERE Billing Reports

Use HERE’s billing dashboard to compare your internal usage logs with actual billed usage. This helps validate your tracking accuracy.