marketing Engagements Deletemutation
Requires write
access scope.
Marks channel-level engagement data such that it no longer appears in reports. Activity-level data cannot be deleted directly, instead the MarketingActivity itself should be deleted to hide it from reports.
Arguments
Anchor to channelHandlechannelHandleThe handle of the channel for which engagement data should be deleted.
When true, engagements for all channels that belong to the api client will be deleted.
MarketingEngagementsDeletePayload returns
Informational message about the engagement data that has been marked for deletion.
The list of errors that occurred from executing the mutation.
Code examples for MUTATION: marketingEngagementsDelete
Query Reference for MUTATION: marketingEngagementsDelete
"mutation marketingEngagementsDelete {\n marketingEngagementsDelete {\n result\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: marketingEngagementsDelete
"{\n \"channelHandle\": \"<your-channelHandle>\",\n \"deleteEngagementsForAllChannels\": true\n}"
Schema Reference for MUTATION: marketingEngagementsDelete
""
Display Examples for MUTATION: marketingEngagementsDelete
[ { "example": { "type_name": "marketingengagementsdelete", "title": "Mark all channel level engagement data associated to the api client for deletion", "query_string": "mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n}", "response": { "data": { "marketingEngagementsDelete": { "result": "Engagement data marked for deletion for 5 channel(s)", "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/merchant_marketing/test/unit/graph_api/admin/mutations/marketing_engagements_delete_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) { marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) { result userErrors { field message } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [] }, { "example": { "type_name": "marketingengagementsdelete", "title": "Mark engagement data associated to a specific channel for deletion", "query_string": "mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n}", "response": { "data": { "marketingEngagementsDelete": { "result": "Engagement data associated to channel handle 'my-channel-handle' marked for deletion", "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/merchant_marketing/test/unit/graph_api/admin/mutations/marketing_engagements_delete_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) { marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) { result userErrors { field message } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation M($channelHandle: String, $deleteEngagementsForAllChannels: Boolean) {\n marketingEngagementsDelete(channelHandle: $channelHandle, deleteEngagementsForAllChannels: $deleteEngagementsForAllChannels) {\n result\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [] } ]