Skip to main content

The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.

MarketingEvent

Multiple access scopes needed — refer to each endpoint for access scope requirements.

Marketing events represent actions taken by your app, on behalf of the merchant, to market products, collections, discounts, pages, blog posts, and other features. These actions target multiple potential customers, rather than specific individuals. For example, you should model your marketing event at the email campaign level, rather than on a per-email basis.

Merchants get value from marketing events because they help them understand sales and traffic attribution. Implementing marketing events for your app is beneficial because it enables Shopify to surface your app in the Shopify admin in ways that are helpful to merchants. Examples of marketing events include an ad campaign that drives multiple potential customers to a product page, or an email marketing campaign advertising a discount code.

Marketing events can be created for email campaigns, affiliate links, advertisements, and other common marketing tactics. Marketing events include the event_type and marketing_channel properties that help Shopify to rank your app and surface it in the Shopify admin in ways that are useful to merchants. Traffic and order attribution for your app is handled by providing UTM parameters with your marketing events. The same UTM parameters are also used in the links provided in the marketing event.

Engagements can also be added to marketing events to give merchants more insight into how potential customers interact with your marketing events. For example, engagements for ad campaigns can include clicks, shares, and comments. Creating engagements is optional, and not all marketing events include engagements.

Was this section helpful?

Anchor to

The MarketingEvent resource

Anchor to

Properties


remote_id

An optional remote identifier for a marketing event. The remote identifier lets Shopify validate engagement data.


event_type

The type of marketing event. Valid values: ad, post, message, retargeting, transactional, affiliate, loyalty, newsletter, abandoned_cart.

Note

If there are values that you’d like to use for event_type that are not in the list above, then please share your request in the Shopify Community APIs and SDKs discussion board providing as much detail as possible. Our approach is to be more structured than using freeform text, but to still allow for categorization of most types of marketing actions.


marketing_channel

The channel that your marketing event will use. Valid values: search, display, social, email, referral.


paid
deprecated

Whether the event is paid or organic.


referring_domain
deprecated

The destination domain of the marketing event. Required if the marketing_channel is set to search or social.


budget

The budget of the ad campaign.


currency

The currency for the budget. Required if budget is specified.


budget_type

The type of the budget. Required if budget is specified. Valid values: daily, lifetime.'


started_at

The time when the marketing action was started.


scheduled_to_end_at

For events with a duration, the time when the event was scheduled to end.


ended_at

For events with a duration, the time when the event actually ended.


UTM parameters

The UTM parameters used in the links provided in the marketing event. Values must be unique and should not be url-encoded.

To do traffic or order attribution you must at least define utm_campaign, utm_source, and utm_medium.


Was this section helpful?
{}

The MarketingEvent resource

{
"remote_id": "123abc",
"event_type": "ad",
"marketing_channel": "social",
"paid": true,
"referring_domain": "facebook.com",
"budget": 10.75,
"currency": "USD",
"budget_type": "lifetime",
"started_at": "2025-01-15T11:56:18-04:00",
"scheduled_to_end_at": "2025-01-22T11:56:18-04:00",
"ended_at": "2025-01-20T11:56:18-04:00",
"UTM parameters": {
"marketing_event": {
"utm_campaign": "CanadaDay2025",
"utm_source": "facebook",
"utm_medium": "cpc"
}
},
"description": "Facebook carousel ad 2025",
"manage_url": "https://mymarketingapp.com/ad/1234",
"preview_url": "https://www.facebook.com/123456/",
"marketed_resources": [
{
"type": "product",
"id": 12345
}
]
}

Anchor to POST request, Creates a marketing event
post
Creates a marketing event

Requires marketing_events access scope.

Marketing events can be created to track ad campaigns that target a specific time of year. For example, a marketing event can be created to track a Facebook ad campaign for Christmas 2022. When creating the marketing event, the body of the request includes the UTM parameters that must be included in the links provided in the marketing event. Each marketing event also includes the event_type and marketing_channel properties that help Shopify to rank your app and surface it within Shopify admin.


After a marketing event is created in Shopify, you can start to drive traffic to Shopify. Make sure that the links for the marketing event contain the same UTM parameters that were defined in the marketing event. For example, marketing activities for the Christmas 2022 ad campaign would use the following URL convention:


https://storename.com/product?utm_source=facebook&utm_medium=cpc&utm_campaign=Christmas2022-12142018

Anchor to Parameters of Creates a marketing eventParameters


api_version
string
required

Was this section helpful?

Anchor to post-marketing-events-examplesExamples

Create a marketing event

Request body
marketing_event
Marketing_event resource
Show marketing_event properties
marketing_event.started_at:"2025-12-15"

The time when the marketing action was started.

marketing_event.event_type:"ad"

The type of marketing event. Valid values: ad, post, message, retargeting, transactional, affiliate, loyalty, newsletter, abandoned_cart.

Note

If there are values that you’d like to use for event_type that are not in the list above, then please share your request in the Shopify Community APIs and SDKs discussion board providing as much detail as possible. Our approach is to be more structured than using freeform text, but to still allow for categorization of most types of marketing actions.

marketing_event.referring_domain:"facebook.com"
deprecated

The destination domain of the marketing event. Required if the marketing_channel is set to search or social.

marketing_event.marketing_channel:"social"

The channel that your marketing event will use. Valid values: search, display, social, email, referral.

marketing_event.paid:true
deprecated

Whether the event is paid or organic.

Was this section helpful?
post

/admin/api/2025-07/marketing_events.json

curl -d '{"marketing_event":{"started_at":"2025-12-15","utm_campaign":"Christmas2025","utm_source":"facebook","utm_medium":"cpc","event_type":"ad","referring_domain":"facebook.com","marketing_channel":"social","paid":true}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 201 Created
{
"marketing_event": {
"id": 1069063883,
"event_type": "ad",
"remote_id": null,
"started_at": "2025-12-15T01:00:00-05:00",
"ended_at": null,
"scheduled_to_end_at": null,
"budget": null,
"currency": null,
"manage_url": null,
"preview_url": null,
"utm_campaign": "Christmas2025",
"utm_source": "facebook",
"utm_medium": "cpc",
"budget_type": null,
"description": null,
"marketing_channel": "social",
"paid": true,
"referring_domain": "facebook.com",
"breadcrumb_id": null,
"marketing_activity_id": 1063897333,
"admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883",
"marketed_resources": []
}
}

Anchor to POST request, Creates marketing engagements on a marketing event
post
Creates marketing engagements on a marketing event

Engagements on marketing events represent customer activity taken on the marketing event before customers reach the shop’s website. Not all types of marketing events will necessarily have engagement, and most types of marketing events will only use a subset of the possible engagement types.


Engagements are aggregated on a daily basis. However, the data can be sent more often than once a day if the information is available. If you create an engagement with the same value for occurred_on as an existing engagement, then the new engagement will overwrite the previous one.

Anchor to Parameters of Creates marketing engagements on a marketing eventParameters


api_version
string
required

marketing_event_id
string
required

occurred_on
required

The date that these engagements occurred on, in the format “YYYY-MM-DD”.


ad_spend

The total ad spend for the day, if the marketing event is a paid ad with a daily spend.


clicks_count

The total number of clicks on the marketing event for the day.


comments_count

The total number of comments for the day.


favorites_count

The total number of favorites for the day.


impressions_count

The total number of impressions for the day. An impression occurs when the marketing event is served to a customer, either as a email or through a marketing channel.


is_cumulative

Whether the engagements are reported as lifetime values rather than daily totals.


shares_count

The total number of shares for the day.


views_count

The total number of views for the day. A view occurs when a customer reads the marketing event that was served to them, for example, if the customer opens the email or spends time looking at a Facebook post.


Was this section helpful?

Anchor to post-marketing-events-marketing-event-id-engagements-examplesExamples

Add engagements to a marketing engagement

Path parameters
marketing_event_id=998730532
string
required
Was this section helpful?
post

/admin/api/2025-07/marketing_events/998730532/engagements.json

curl -d '{"engagements":[{"occurred_on":"2025-01-15","views_count":0,"clicks_count":0,"favorites_count":0,"ad_spend":10.0,"is_cumulative":true},{"occurred_on":"2025-01-16","views_count":100,"clicks_count":50,"is_cumulative":true},{"occurred_on":"2025-01-17","views_count":200,"clicks_count":100,"is_cumulative":true}]}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events/998730532/engagements.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 201 Created
{
"engagements": [
{
"occurred_on": "2025-01-15",
"fetched_at": null,
"views_count": 0,
"impressions_count": null,
"clicks_count": 0,
"favorites_count": 0,
"comments_count": null,
"shares_count": null,
"ad_spend": "10.0",
"currency_code": null,
"is_cumulative": true,
"unsubscribes_count": null,
"complaints_count": null,
"fails_count": null,
"sends_count": null,
"unique_views_count": null,
"unique_clicks_count": null,
"utc_offset": null
},
{
"occurred_on": "2025-01-16",
"fetched_at": null,
"views_count": 100,
"impressions_count": null,
"clicks_count": 50,
"favorites_count": null,
"comments_count": null,
"shares_count": null,
"ad_spend": null,
"currency_code": null,
"is_cumulative": true,
"unsubscribes_count": null,
"complaints_count": null,
"fails_count": null,
"sends_count": null,
"unique_views_count": null,
"unique_clicks_count": null,
"utc_offset": null
},
{
"occurred_on": "2025-01-17",
"fetched_at": null,
"views_count": 200,
"impressions_count": null,
"clicks_count": 100,
"favorites_count": null,
"comments_count": null,
"shares_count": null,
"ad_spend": null,
"currency_code": null,
"is_cumulative": true,
"unsubscribes_count": null,
"complaints_count": null,
"fails_count": null,
"sends_count": null,
"unique_views_count": null,
"unique_clicks_count": null,
"utc_offset": null
}
]
}

Anchor to GET request, Retrieves a list of all marketing events
get
Retrieves a list of all marketing events

Requires marketing_events access scope.

Retrieves a list of all marketing events. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.


api_version
string
required

limit
≤ 250
default 50

The amount of results to return.


offset

The number of marketing events to skip.


Was this section helpful?

Retrieve all marketing events

Was this section helpful?
get

/admin/api/2025-07/marketing_events.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"marketing_events": [
{
"id": 998730532,
"event_type": "post",
"remote_id": "12345678",
"started_at": "2025-01-15T10:56:18-05:00",
"ended_at": null,
"scheduled_to_end_at": null,
"budget": "10.11",
"currency": "GBP",
"manage_url": null,
"preview_url": null,
"utm_campaign": "1234567890",
"utm_source": "facebook",
"utm_medium": "facebook-post",
"budget_type": "daily",
"description": null,
"marketing_channel": "social",
"paid": false,
"referring_domain": "facebook.com",
"breadcrumb_id": null,
"marketing_activity_id": null,
"admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532",
"marketed_resources": []
}
]
}

Requires marketing_events access scope.

Retrieves a single marketing event


api_version
string
required

marketing_event_id
string
required

Was this section helpful?

Retrieve a single marketing event by its ID

Path parameters
marketing_event_id=998730532
string
required
Was this section helpful?
get

/admin/api/2025-07/marketing_events/998730532.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events/998730532.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"marketing_event": {
"id": 998730532,
"event_type": "post",
"remote_id": "12345678",
"started_at": "2025-01-15T10:56:18-05:00",
"ended_at": null,
"scheduled_to_end_at": null,
"budget": "10.11",
"currency": "GBP",
"manage_url": null,
"preview_url": null,
"utm_campaign": "1234567890",
"utm_source": "facebook",
"utm_medium": "facebook-post",
"budget_type": "daily",
"description": null,
"marketing_channel": "social",
"paid": false,
"referring_domain": "facebook.com",
"breadcrumb_id": null,
"marketing_activity_id": null,
"admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532",
"marketed_resources": []
}
}

Anchor to GET request, Retrieves a count of all marketing events
get
Retrieves a count of all marketing events
deprecated

Requires marketing_events access scope.

Retrieves a count of all marketing events


api_version
string
required

Was this section helpful?

Retrieve a count all marketing events

Was this section helpful?
get

/admin/api/2025-07/marketing_events/count.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events/count.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"count": 1
}

Requires marketing_events access scope.

Updates a marketing event


api_version
string
required

marketing_event_id
string
required

Was this section helpful?

Update a marketing event. Can modify only timestamps, remote_id, and budget/currency.

Path parameters
marketing_event_id=998730532
string
required
Request body
marketing_event
Marketing_event resource
Show marketing_event properties
marketing_event.remote_id:"1000:2000"

An optional remote identifier for a marketing event. The remote identifier lets Shopify validate engagement data.

marketing_event.started_at:"2025-02-02T00:00 +00:00"

The time when the marketing action was started.

marketing_event.ended_at:"2025-02-03T00:00 +00:00"
->
end

For events with a duration, the time when the event actually ended.

marketing_event.scheduled_to_end_at:"2025-02-04T00:00 +00:00"

For events with a duration, the time when the event was scheduled to end.

marketing_event.budget:"11.1"

The budget of the ad campaign.

marketing_event.budget_type:"daily"

The type of the budget. Required if budget is specified. Valid values: daily, lifetime.'

marketing_event.currency:"CAD"

The currency for the budget. Required if budget is specified.

marketing_event.event_type:"ad"

The type of marketing event. Valid values: ad, post, message, retargeting, transactional, affiliate, loyalty, newsletter, abandoned_cart.

Note

If there are values that you’d like to use for event_type that are not in the list above, then please share your request in the Shopify Community APIs and SDKs discussion board providing as much detail as possible. Our approach is to be more structured than using freeform text, but to still allow for categorization of most types of marketing actions.

marketing_event.referring_domain:"instagram.com"
deprecated

The destination domain of the marketing event. Required if the marketing_channel is set to search or social.

Was this section helpful?
put

/admin/api/2025-07/marketing_events/998730532.json

curl -d '{"marketing_event":{"id":998730532,"remote_id":"1000:2000","started_at":"2025-02-02T00:00 +00:00","ended_at":"2025-02-03T00:00 +00:00","scheduled_to_end_at":"2025-02-04T00:00 +00:00","budget":"11.1","budget_type":"daily","currency":"CAD","utm_campaign":"other","utm_source":"other","utm_medium":"other","event_type":"ad","referring_domain":"instagram.com"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events/998730532.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 200 OK
{
"marketing_event": {
"started_at": "2025-02-01T19:00:00-05:00",
"ended_at": "2025-02-02T19:00:00-05:00",
"scheduled_to_end_at": "2025-02-03T19:00:00-05:00",
"remote_id": "1000:2000",
"currency": "CAD",
"budget": "11.1",
"budget_type": "daily",
"event_type": "post",
"id": 998730532,
"manage_url": null,
"preview_url": null,
"utm_campaign": "1234567890",
"utm_source": "facebook",
"utm_medium": "facebook-post",
"description": null,
"marketing_channel": "social",
"paid": false,
"referring_domain": "facebook.com",
"breadcrumb_id": null,
"marketing_activity_id": null,
"admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532",
"marketed_resources": []
}
}

Requires marketing_events access scope.

Deletes a marketing event


api_version
string
required

marketing_event_id
string
required

Was this section helpful?

Delete a marketing event

Path parameters
marketing_event_id=998730532
string
required
Was this section helpful?
del

/admin/api/2025-07/marketing_events/998730532.json

curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-07/marketing_events/998730532.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{}