Skip to main content
object

Requires read_reports access scope.

Represents a merchant-defined goal for a specific analytics metric over a date range. Merchants use analytics targets to track progress toward business objectives, such as reaching a total sales amount or a number of orders within a given period.

Each target is associated with a single metric and can optionally include filter expressions to narrow the evaluated data. Use the analyticsTargets query to retrieve targets, and the analyticsTargetCreate, analyticsTargetUpdate, and analyticsTargetsDelete mutations to manage them.

•DateTime!
non-null

The date and time when the analytics target was created.

•CurrencyCode!
non-null

The currency code stored on the target's expected value. Defaults to the shop currency when the target is created.

•Date!
non-null

The end date of the period over which progress toward the target is measured.

•Decimal!
non-null

The goal value that the merchant aims to reach for the tracked metric within the target period. Must be greater than 0.

•String

An optional filter expression to narrow the data evaluated against this target. For example, shipping_country = 'US'.

•ID!
non-null

A globally-unique ID.

•String!
non-null

The identifier of the analytics metric that this target tracks, such as total_sales or orders.

•String!
non-null

A human-readable label for the target, such as Q1 Sales Target.

Anchor to presentmentExpectedValuepresentmentExpectedValue
•MoneyV2

The target's expected value converted to a specified presentment currency. Returns null when the target metric isn't a money metric or the conversion rate is unavailable.

Arguments

•CurrencyCode!
required

The currency code to convert the expected value into.


•String

A generated ShopifyQL query string that fetches the current value of the tracked metric for this target's date range and filters.

•Date!
non-null

The start date of the period over which progress toward the target is measured.

•DateTime!
non-null

The date and time when the analytics target was last updated.


Was this section helpful?

•query

Returns a paginated list of analytics targets for the shop. Each target represents a merchant-defined goal for a specific metric over a date range.

Results can be filtered by metric, name, date range, or filter expression, and sorted by fields such as start_date, expected_value, or metric.

Use the analyticsTargetCreate mutation to add new targets.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•AnalyticsTargetSortKeys
Default:ID

Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to end_date
•date

Filter by the end date of the target period.

Example:

  • end_date:2026-03-31
  • end_date:<=2026-03-31
Anchor to filters
•string

Filter by the target's filter expression.

Example:

  • filters:"shipping_country = 'US'"
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string

Filter by metric identifier.

Example:

  • metric:total_sales
•string

Filter by target name.

Example:

  • name:Q1 Sales Target
Anchor to start_date
•date

Filter by the start date of the target period.

Example:

  • start_date:2026-01-01
  • start_date:>=2026-01-01


Was this section helpful?

•mutation

Creates an analytics target that defines a merchant's goal for a specific metric over a date range. For example, a merchant can set a target of $50,000 in total sales for a quarter, or 1,000 orders in a month.

Provide the target attributes through the input argument. The target's currency is set to the shop's currency. A target is uniquely identified by the combination of metric, startDate, endDate, and filters — attempting to create a duplicate returns a user error.

Use analyticsTargetUpdate to modify an existing target, or analyticsTargetsDelete to remove targets.

Arguments

•AnalyticsTargetCreateInput!
required

The input fields for creating an analytics target.


•mutation

Updates an existing analytics target. Only the fields provided in the input argument are modified; omitted fields remain unchanged. Setting a nullable field to null clears its value.

Use analyticsTargetCreate to create a new target, or analyticsTargetsDelete to remove targets.

Arguments

•ID!
required

The ID of the analytics target to update.

•AnalyticsTargetUpdateInput!
required

The input fields for updating an analytics target.



Was this section helpful?

•interface

Was this section helpful?