AMP Source

The Segment AMP component makes it easy to send your data to lots of tools without having to learn, test or implement a new AMP component every time. The component automatically collects default properties and sends a page view.

NOTE: Since our AMP source sends data directly to our servers, only destinations that support cloud-based connection modes are compatible with AMP.

Getting Started

If you’re new to AMP, go through their excellent Quickstart. Once you’re setup, follow the steps below to implement Segment.

Troubleshooting

Can I use client-side Destinations?

No. All AMP data is sent from Google’s servers to our server-side API and subsequently only onto our server-side Destinations. You will only be able to use our server-side destinations and their relevant setting. For example, for Google Analytics, please use the “Server-side Tracking ID”.

How do I identify users?

Because AMP is static, it doesn’t provide many options for persistently identifying users. AMP provides a basic cookie mechanism called an AMP Client ID which is a uniquely generated cookie for every unique end user’s AMP session. Depending on Google’s caching settings, you may receive multiple AMP Client IDs for the same user. Segment will capture this AMP Client ID as an anonymous_id and it will be of this format: amp-REDmCPH4F0QX44kCFomrcA.

How do I manager user identities client-side and server-side?

There is no user identity management client-side with AMP, so to join user sessions together you’ll need to capture the AMP Client ID on your server-side and join it with your user_id in your warehouse.

This identity schema will allow you to join down funnel interaction with earlier website browsing behavior. On the server-side, you can grab the amp_client_id from the ajs_anonymous_id header.

Why aren’t all my IDs prefixed with an ‘amp-‘?

All AMP events won’t consistently have an ‘amp-‘ prefixed ID as this is only included in the event that the AMP page is directly visited on your domain. For further details please refer to the various Client ID scenarios in relation to AMP pages here (we can only guarantee that if the 3rd scenario happens, the AMP ID will get generated and picked up).