--- title: AnalyticsTarget - GraphQL Admin description: >- 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`](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) query to retrieve targets, and the [`analyticsTargetCreate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate), [`analyticsTargetUpdate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate), and [`analyticsTargetsDelete`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetsDelete) mutations to manage them. api_version: unstable api_name: admin source_url: html: 'https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget' md: >- https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget.md metadata: domain: admin --- # Analytics​Target 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`](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) query to retrieve targets, and the [`analyticsTargetCreate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate), [`analyticsTargetUpdate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate), and [`analyticsTargetsDelete`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetsDelete) mutations to manage them. ## Fields * created​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) non-null The date and time when the analytics target was created. * currency​Code [Currency​Code!](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CurrencyCode) non-null The currency code stored on the target's expected value. Defaults to the shop currency when the target is created. * end​Date [Date!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) non-null The end date of the period over which progress toward the target is measured. * expected​Value [Decimal!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/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. * filters [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) An optional filter expression to narrow the data evaluated against this target. For example, `shipping_country = 'US'`. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) non-null A globally-unique ID. * metric [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) non-null The identifier of the analytics metric that this target tracks, such as `total_sales` or `orders`. * name [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) non-null A human-readable label for the target, such as `Q1 Sales Target`. * presentment​Expected​Value [Money​V2](https://shopify.dev/docs/api/admin-graphql/unstable/objects/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. * currency​Code [Currency​Code!](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CurrencyCode) required ### Arguments The currency code to convert the expected value into. *** * shopifyql​Query [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) A generated [ShopifyQL](https://shopify.dev/docs/api/shopifyql) query string that fetches the current value of the tracked metric for this target's date range and filters. * start​Date [Date!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) non-null The start date of the period over which progress toward the target is measured. * updated​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) non-null The date and time when the analytics target was last updated. *** ## Map ### Fields and connections with this object * [AnalyticsTargetConnection.nodes](https://shopify.dev/docs/api/admin-graphql/unstable/connections/AnalyticsTargetConnection#returns-nodes) * [AnalyticsTargetEdge.node](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTargetEdge#field-AnalyticsTargetEdge.fields.node) * [ShopifyqlQueryResponse.analyticsTargets](https://shopify.dev/docs/api/admin-graphql/unstable/objects/ShopifyqlQueryResponse#field-ShopifyqlQueryResponse.fields.analyticsTargets) *** ## Queries * [analytics​Targets](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) query Returns a paginated list of [analytics targets](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget) 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`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) mutation to add new targets. * first [Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Analytics​Target​Sort​Keys](https://shopify.dev/docs/api/admin-graphql/unstable/enums/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](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations). * query [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/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](https://shopify.dev/api/usage/search-syntax). * * default string * end\_date date * filters string * id id * metric string * name string * start\_date date - Filter by a case-insensitive search of multiple fields in a document. - Example: * `query=Bob Norman` * `query=title:green hoodie` Filter by the end date of the target period. - Example: * `end_date:2026-03-31` * `end_date:<=2026-03-31` Filter by the target's filter expression. - Example: * `filters:"shipping_country = 'US'"` Filter by `id` range. - Example: * `id:1234` * `id:>=1234` * `id:<=1234` Filter by metric identifier. - Example: * `metric:total_sales` Filter by target name. - Example: * `name:Q1 Sales Target` Filter by the start date of the target period. Example: * `start_date:2026-01-01` * `start_date:>=2026-01-01` *** *** ## AnalyticsTarget Queries ### Queried by * [analytics​Targets](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) *** ## Mutations * [analytics​Target​Create](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) mutation Creates an [analytics target](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget) 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`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate) to modify an existing target, or [`analyticsTargetsDelete`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetsDelete) to remove targets. * input [Analytics​Target​Create​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/AnalyticsTargetCreateInput) required ### Arguments The input fields for creating an [analytics target](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget). *** * [analytics​Target​Update](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate) mutation Updates an existing [analytics target](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget). 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`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) to create a new target, or [`analyticsTargetsDelete`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetsDelete) to remove targets. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the analytics target to update. * input [Analytics​Target​Update​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/AnalyticsTargetUpdateInput) required The input fields for updating an [analytics target](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget). *** *** ## AnalyticsTarget Mutations ### Mutated by * [analytics​Target​Create](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) * [analytics​Target​Update](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate) *** ## Interfaces * [Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node) interface *** ## AnalyticsTarget Implements ### Implements * [Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node)