extensions/amp-analytics/integrating-analytics.md
If you operate a software-as-a-service tool for publishers to better understand their traffic and visitors, you may want to integrate your service into amp-analytics. This will enable your customers to view traffic patterns for their AMP HTML pages.
Before you can add your analytics service to AMP HTML runtime, you may need to:
amp-analytics, and file requests for needed features.iframe, variables are sent as query string parameters in a HTTPS request.iframe transport type, an iframe is created and variables are sent to it via window.postMessage. In this case, the message need not be a URL. This option is available only to MRC-accredited vendors.amp-analytics may impact any policies (particularly your privacy policy) or agreements you may have.${vendorName}.json in the vendors folder including any options above and beyond the default, such as:
"vars": {} for additional default variables."requests": {} for requests that your service will use."optout": if needed. We currently don't have a great opt-out system, so please reach out to help us design one that works well for you."warningMessage": if needed. Displays warning information from the vendor (such as deprecation or migration) in the console."*vendor-name*": "*url*"Tag management services have two options for integrating with AMP Analytics:
amp-analytics, and conducting marketing management in the backend.The endpoint approach is the same as the standard approach detailed in the previous section. The config approach consists of creating a unique configuration for amp-analytics that is specific to each publisher and includes all of their compatible analytics packages. A publisher would include the configuration using a syntax similar to this:
<amp-analytics
config="https://my-awesome-tag-manager.example.com/user-id.json"
></amp-analytics>
To take this approach, review the documentation for publishers' integration with AMP Analytics.