marketingActivityUpdateExternal
Requires access scope.
Update an external marketing activity.
Arguments
- Anchor to inputinput•
The input field for updating an external marketing activity.
- Anchor to marketingActivityIdmarketing•
Activity Id The ID of the marketing activity. Specify either the marketing activity ID, remote ID, or UTM to update the marketing activity.
- Anchor to remoteIdremote•
Id A custom unique identifier for the marketing activity, which can be used to manage the activity and send engagement metrics without having to store our marketing activity ID in your systems. Specify either the marketing activity ID, remote ID, or UTM to update the marketing activity.
- •
Specifies the Urchin Traffic Module (UTM) parameters that are associated with a related marketing campaign. Specify either the marketing activity ID, remote ID, or UTM to update the marketing activity.
Anchor to MarketingActivityUpdateExternalPayload returnsMarketingActivityUpdateExternalPayload returns
- Anchor to marketingActivitymarketing•
Activity The updated marketing activity.
- Anchor to userErrorsuser•
Errors [MarketingActivity non-nullUser Error!]! The list of errors that occurred from executing the mutation.
- Update an external marketing activity and its status
- Update an external marketing activity using the remote id
- Update an external marketing activity using the utm parameters
- Updates a marketing event
- marketingActivityUpdateExternal reference
Examples
mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {
marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {
marketingActivity {
id
title
marketingEvent {
manageUrl
previewUrl
}
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) { marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) { marketingActivity { id title marketingEvent { manageUrl previewUrl } } } }",
"variables": {
"remoteId": "abcdefg",
"updateInput": {
"title": "New Title",
"remoteUrl": "https://example.com",
"remotePreviewImageUrl": "https://example.com",
"status": "PAUSED"
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {
marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {
marketingActivity {
id
title
marketingEvent {
manageUrl
previewUrl
}
}
}
}`,
{
variables: {
"remoteId": "abcdefg",
"updateInput": {
"title": "New Title",
"remoteUrl": "https://example.com",
"remotePreviewImageUrl": "https://example.com",
"status": "PAUSED"
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {
marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {
marketingActivity {
id
title
marketingEvent {
manageUrl
previewUrl
}
}
}
}`,
"variables": {
"remoteId": "abcdefg",
"updateInput": {
"title": "New Title",
"remoteUrl": "https://example.com",
"remotePreviewImageUrl": "https://example.com",
"status": "PAUSED"
}
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation marketingActivityUpdateExternal($remoteId: String!, $updateInput: MarketingActivityUpdateExternalInput!) {
marketingActivityUpdateExternal(remoteId: $remoteId, input: $updateInput) {
marketingActivity {
id
title
marketingEvent {
manageUrl
previewUrl
}
}
}
}
QUERY
variables = {
"remoteId": "abcdefg",
"updateInput": {
"title": "New Title",
"remoteUrl": "https://example.com",
"remotePreviewImageUrl": "https://example.com",
"status": "PAUSED"
}
}
response = client.query(query: query, variables: variables)