A detour goes up on Route 5 at 7:15 in the morning. Fifteen minutes later, a rider checks Google Maps before leaving the house and sees the closed stop marked, with an alternate stop and a short note about why. Nobody called them, and nobody posted to social media in time. The map simply knew. The agency had already learned how to publish transit service alerts into a GTFS-Realtime feed and register that feed with the apps riders actually use.
This is a procedure, not a concept. Read why alerts do not reach Google Maps first if the mechanism still needs explaining. If you are ready to build the thing, six steps get you from a written detour to a marker on the map. That holds whether your agency already publishes GTFS-Realtime positions or has never touched a realtime feed.
How to Publish Transit Service Alerts: What You Need Before You Start
You need three things. A General Transit Feed Specification (GTFS) schedule feed that already validates cleanly. A public URL that never changes. And a way to generate a GTFS-Realtime (GTFS-RT) alerts file called alerts.pb. Positions, trip updates, and dispatch software are not required, since an alerts feed can stand entirely on its own.
Here is what each of those three means in practice.
- A live GTFS schedule feed. Your routes, stops, and trips, already published as a static GTFS dataset. If Google Maps or a transit app already shows your fixed routes, you have this piece.
- A stable public URL. A location on your server that never requires a login and never moves, because every consuming app polls it on its own schedule.
- A way to generate
alerts.pb. A file in the GTFS-Realtime Protocol Buffers format describing what is affected, when, and why. See how the alerts feed fields work for the full reference.
Step 1: Confirm Your GTFS Schedule Feed Is Live and Valid
Everything here depends on a GTFS schedule feed that already validates cleanly. GTFS-Realtime alerts reference the route IDs, stop IDs, and trip IDs defined in that static feed. If those IDs do not match exactly, an alert can publish successfully and still point at nothing.
Pull your current feed and run it through a GTFS validator before touching realtime data. If your agency has no public GTFS feed at all, stop here and build that first. Without one, an alerts feed has no route or stop identifiers to reference, and no consuming app will show it. Most agencies running fixed routes already publish this feed, often through the same vendor who builds their printed schedules.
Step 2: Decide Who Generates the Alerts Feed
If your agency already publishes GTFS-Realtime vehicle positions, check what your CAD/AVL vendor’s contract actually covers. Positions and trip updates come from onboard hardware almost automatically. The alerts feed is a separate file generated by a separate process, and many CAD/AVL contracts do not include it. Ask directly: does the existing feed produce alerts.pb, or only vehicle_positions.pb and trip_updates.pb? For most small agencies, the honest answer is the latter.
If your agency has no realtime data at all, positions and trip updates are still not required to publish alerts. GTFS-Realtime defines three independent feed types: vehicle positions, trip updates, and alerts. An agency can publish only alerts.pb and skip the other two, provided the static schedule feed from Step 1 is in place.
Someone still has to generate that file, and there are two routes to doing it. The manual route means encoding each alert into the GTFS-Realtime Protocol Buffers format with a script or command-line tool, then redeploying the file every time an alert is added, changed, or resolved. The specification has no spreadsheet or drag-and-drop editor. Agencies that take this route usually hand it to whoever already owns the GTFS schedule feed.
The other route is software that generates and hosts the file automatically. TransitFare’s Transit Alerts module works this way. An agency composes an alert once, in a browser, and the same publish updates the GTFS-Realtime alert feed, the website, email, SMS, and social media. Agencies that would rather not build and maintain the encoding pipeline themselves typically go live on Transit Alerts in about 4 weeks instead of starting at Step 3.
Step 3: Create the Alert With the Right Entity Selectors
This is the step where most agencies end up with a working feed and a useless alert. The file validates and the URL responds, but Google Maps shows nothing, because the alert was never told what it applies to.
Every alert carries an informed_entity field holding one or more EntitySelector entries: that selector is what scopes the alert to something a rider actually sees. Leave it empty or point it at the wrong ID, and the alert reaches no one. The GTFS-Realtime reference on gtfs.org defines the ways to scope an alert. These four matter most:
- Agency. The broadest selector, tied to your
agency_id. Use it for something that affects every route: a holiday schedule, a systemwide fare change. - Route. Tied to
route_id, exactly as it appears in your staticroutes.txt. Use it for a detour or suspension across an entire line. MobilityData’s best practices are specific: scope a line-wide detour to the route once, not to every stop on it. - Stop. Tied to
stop_id. Use it for something local: a closed stop, a temporary relocation, construction blocking one shelter. - Trip. Tied to
trip_id. Use it for a single canceled or rerouted trip rather than the whole route around it.
The failure mode is usually an ID mismatch, not a missing selector. An agency renumbers a route in its static schedule and forgets the realtime side still references the old ID. The alert stays technically live and completely invisible. Copy the exact route_id, stop_id, or trip_id from your current static feed rather than retyping it from memory.
Step 4: Publish the Feed at a Stable URL
Once the alert encodes correctly, it needs a home. Google’s guidance on creating a GTFS-Realtime feed and MobilityData’s best practices agree: the feed needs a public, permanent URL, served over HTTPS, with no login or session token required. Every consuming app polls that exact address on its own schedule. A URL that moves, expires, or sits behind authentication breaks silently for every app at once.
Freshness matters as much as the address. Best practice puts alert data at no older than 10 minutes, refreshed at least every 30 seconds or whenever content changes, with fewer than 1% of requests returning an invalid response. A feed that goes stale or errors out intermittently gets treated as unreliable for every alert on it, not only the one that broke.
Step 5: Register the Feed With Google, Apple, and the Transit Apps
Publishing the file is necessary and not sufficient. Each consuming app has to know your feed exists, and each one runs its own process.
Google Maps. Google runs a formal Transit Partner Program: an agency checks eligibility, submits the feed URL, and picks a data submission method through the Transit Partners portal. Google reviews the feed against its own quality bar before it goes live for riders. That review takes real time, separate from how fast an alert updates once the feed is already approved.
Transit app. Transit’s partner documentation is direct: it asks for a real GTFS-Realtime alerts feed, registered the same way as for Google. If your only realtime data is in a nonstandard format, Transit’s data team takes direct requests at data@transitapp.com instead of offering a self-serve fallback.
Apple Maps. The honest gap: Apple runs no public, self-service submission process comparable to Google’s or Transit’s. Publishing a compliant feed is still worth doing, since it is the baseline Apple would need if your agency gets onboarded. Coverage depends on Apple’s own transit team, not a form you fill out. Do not promise riders Apple Maps coverage on a timeline you do not control.
Everything else. Aggregators and smaller trip-planning apps often pick up a registered, validating feed on their own once it is indexed.
Step 6: Verify It Appeared
Confirm the mechanics before you confirm the map. Run the feed through a GTFS-Realtime validator, check that your alert carries the entity selector you expect, then check the specific route, stop, or trip in Google Maps directly, not the general area. A correctly scoped alert only shows on the entity it is scoped to.
Timing has two different clocks. Getting a new feed approved and live inside Google’s system the first time is a review measured in days, not minutes. Once that feed is live and trusted, individual alert updates typically appear within minutes, since Google is already polling the URL on a short cycle. The first alert on a new feed is the slow one. Every alert after that is fast.
Common Reasons an Alert Does Not Appear
The three most common failures happen before the feed ever reaches a consuming app:
| What you see | What is actually wrong | The fix |
|---|---|---|
| The feed validates, Google Maps shows nothing | The entity selector is empty or points at the wrong ID | Copy the exact route_id, stop_id, or trip_id from your current static feed |
| The alert appeared, then vanished after a few minutes | The feed went stale or the URL returned an error during a poll | Keep alert data under 10 minutes old and monitor the endpoint for uptime |
| The alert shows the wrong route, or one that no longer exists | The static GTFS feed was updated and the realtime feed still references old IDs | Redeploy the static and realtime feeds together, never one without the other |
The other two are about registration, not encoding:
| What you see | What is actually wrong | The fix |
|---|---|---|
| The alert works on your website widget but not in Google Maps | The feed was never registered with Google’s Transit Partner Program | Submit the feed URL and complete Google’s review, not just publish the file |
| The alert works in Google Maps but never shows in Transit or Apple Maps | Each app requires its own registration; there is no universal switch | Complete each app’s separate submission process from Step 5 |
FAQ
Can I Schedule an Alert in Advance?
Yes. The GTFS-Realtime alert specification includes an active_period field, so an alert written now with a future start time goes live automatically. Doing this unattended depends on your generation method: a script has to run on a schedule, while TransitFare’s Alert Dashboard lets you set the future time once and walk away.
What Happens If My Feed Goes Down?
Nothing tells you. Best practice treats alert data older than 10 minutes as stale, so an outage that long risks your active alerts disappearing from the map with no notification sent to your agency. If you host the feed yourself, uptime monitoring is your responsibility.
Do I Need a Developer to Do This?
For the manual path, yes. Encoding a GTFS-Realtime file in the Protocol Buffers format and hosting it reliably is a technical task, and keeping the IDs in sync with route and stop changes is ongoing work, not a one-time setup. Software built to generate the feed removes that requirement, which is the gap Transit Alerts closes.
From a Written Detour to a Marker on the Map
A written detour and a marker on a rider’s map are two different things, connected only by a file most agencies have never had to build. The entity selectors are where it goes wrong, the registration is where it takes patience, and the manual encoding is where it turns tedious fast.
TransitFare is a transit technology company founded in 2012 that builds GTFS and GTFS-Realtime tooling for small and mid-sized transit agencies. Transit Alerts is built for agencies running 10 to 50 vehicles, no in-house developer assumed. TransitFare’s platform backs that: 60 million+ fare validations processed, a strong production reliability record, and over 90% of customers expand to additional modules.
Explore Transit Alerts to see the composer that generates and hosts this feed automatically, or return to why alerts do not reach Google Maps if you are still confirming the problem.
