Analytics Annotation
Requires Requires or access scope.
An annotation for a notable event on a shop's analytics timeline.
Anchor to FieldsFields
- createdAt (DateTime)
- createdByApp (App)
- description (String)
- endedAt (DateTime)
- id (ID!)
- source (AnalyticsAnnotationSource!)
- startedAt (DateTime!)
- title (String)
- type (String!)
- updatedAt (DateTime)
- Anchor to createdAtcreated•Date
At Time The date and time when the annotation was created.
- Anchor to createdByAppcreated•App
By App The app that created the annotation. Returns
nullif the annotation wasn't created by an app.- Anchor to descriptiondescription•String
A plain-text description that provides additional context about the annotation. The maximum length is 150 characters for app-created annotations.
- Anchor to endedAtended•Date
At Time The date and time when the annotation ended. Returns
nullif the annotation is open-ended.- •ID!non-null
A globally-unique ID.
- Anchor to sourcesource•Analytics
Annotation Source! non-null Identifies who or what created this annotation.
- Anchor to startedAtstarted•Date
At Time! non-null The date and time when the annotation started.
- Anchor to titletitle•String
The title of the annotation. The maximum length is 75 characters for app-created annotations.
- Anchor to typetype•String!non-null
The type of event represented by the annotation. Refer to the list of supported types.
- Anchor to updatedAtupdated•Date
At Time The date and time when the annotation was last updated.
Anchor to MutationsMutations
- analyticsAnnotationCreate (AnalyticsAnnotationCreatePayload)
- analyticsAnnotationUpdate (AnalyticsAnnotationUpdatePayload)
- •mutation
Creates an analytics annotation on the shop. Annotations are notable events that can be overlaid on analytics charts to provide context for changes in metrics. The annotation is attributed to the app that calls the mutation.
Shopify limits how many annotations an app can have for a shop. If the app reaches this limit, then the mutation returns a
LIMIT_REACHEDerror. Delete existing annotations or contact Shopify Support to request a higher limit.Use
to modify existing annotations orto remove them.The
typefield must specify a supported type for app-created annotations. Refer to the list of supported types.- Anchor to inputinput•Analytics
Annotation Create Input! required The input fields for creating an analytics annotation.
Arguments
- •mutation
Updates an existing analytics annotation. Only the fields provided in the
inputargument are modified; omitted fields remain unchanged. Settingtonullmakes the annotation open-ended.An app can update only annotations that it created. If an app attempts to update an annotation that it didn't create, then the mutation returns a
NOT_FOUNDerror.Use
to create a new annotation, orto remove it.If provided, the
typefield must specify a supported type for app-created annotations. Refer to the list of supported types.- •ID!required
The ID of the analytics annotation to update.
- Anchor to inputinput•Analytics
Annotation Update Input! required The input fields for updating the analytics annotation.
Arguments
- •ID!