marketingEvent
Returns a MarketingEvent resource by ID.
Anchor to Possible returnsPossible returns
- Anchor to MarketingEventMarketing•
Event Represents actions that market a merchant's store or products.
- app•App!non-null
The app that the marketing event is attributed to.
- channel
Handle •String The unique string identifier of the channel to which this activity belongs. For the correct handle for your channel, contact your partner manager.
- description•String
A human-readable description of the marketing event.
- ended
At •DateTime The date and time when the marketing event ended.
- id•ID!non-null
A globally-unique ID.
- legacy
Resource •Id Unsignednon-nullInt64! The ID of the corresponding resource in the REST Admin API.
- manage
Url •URL The URL where the marketing event can be managed.
- marketing
Channel •Type MarketingChannel The medium through which the marketing activity and event reached consumers. This is used for reporting aggregation.
- preview
Url •URL The URL where the marketing event can be previewed.
- remote
Id •String An optional ID that helps Shopify validate engagement data.
- scheduled
To •End At DateTime The date and time when the marketing event is scheduled to end.
- source
And •Medium String!non-null Where the
occurred and what kind of content was used. Because
and
are often used interchangeably, this is based on a combination of
,
, and
type
to provide a consistent representation for any given piece of marketing regardless of the app that created it.- started
At •Datenon-nullTime! The date and time when the marketing event started.
- type•Marketingnon-null
Tactic! The marketing event type.
- utm
Campaign •String The name of the marketing campaign.
- utm
Medium •String The medium that the marketing campaign is using. Example values:
cpc
,banner
.- utm
Source •String The referrer of the marketing event. Example values:
google
,newsletter
.- channel•MarketingDeprecated
Channel The medium through which the marketing activity and event reached consumers. This is used for reporting aggregation. Use
instead.
- target
Type •Display Text String!non-nullDeprecated The display text for the marketing event type. Use
instead.
- app•
Retrieves a single marketing event
query MarketingEventShow {
marketingEvent(id: "gid://shopify/MarketingEvent/425025702") {
id
type
remoteId
startedAt
endedAt
scheduledToEndAt
manageUrl
previewUrl
utmCampaign
utmMedium
utmSource
description
marketingChannelType
sourceAndMedium
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/unstable/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query MarketingEventShow { marketingEvent(id: \"gid://shopify/MarketingEvent/425025702\") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query MarketingEventShow {
marketingEvent(id: "gid://shopify/MarketingEvent/425025702") {
id
type
remoteId
startedAt
endedAt
scheduledToEndAt
manageUrl
previewUrl
utmCampaign
utmMedium
utmSource
description
marketingChannelType
sourceAndMedium
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query MarketingEventShow {
marketingEvent(id: "gid://shopify/MarketingEvent/425025702") {
id
type
remoteId
startedAt
endedAt
scheduledToEndAt
manageUrl
previewUrl
utmCampaign
utmMedium
utmSource
description
marketingChannelType
sourceAndMedium
}
}`,
});
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
query MarketingEventShow {
marketingEvent(id: "gid://shopify/MarketingEvent/425025702") {
id
type
remoteId
startedAt
endedAt
scheduledToEndAt
manageUrl
previewUrl
utmCampaign
utmMedium
utmSource
description
marketingChannelType
sourceAndMedium
}
}
QUERY
response = client.query(query: query)