Anchor to section titled 'undefined'

marketingEngagementCreate
mutation

Requires write_marketing_events access scope.

Creates a new marketing engagement for a marketing activity or a marketing channel.


The unique string identifier of the channel to which the engagement metrics are being provided. This should be set when and only when providing channel-level engagements. This should be nil when providing activity-level engagements. For the correct handle for your channel, contact your partner manager.

The identifier of the marketing activity for which the engagement metrics are being provided. This or the remoteId should be set when and only when providing activity-level engagements. This should be nil when providing channel-level engagements.

The marketing engagement's attributes.

The ID of an activity that's hosted outside of Shopify. This or the marketingActivityId should be set when and only when providing activity-level engagements. This should be nil when providing channel-level engagements.


Was this section helpful?

The marketing engagement that was created. This represents customer activity taken on a marketing activity or a marketing channel.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
Copy
mutation M($marketingEngagement: MarketingEngagementInput!, $marketingActivityId: ID, $channelHandle: String, $remoteId: String) {
  marketingEngagementCreate(marketingEngagement: $marketingEngagement, marketingActivityId: $marketingActivityId, channelHandle: $channelHandle, remoteId: $remoteId) {
    marketingEngagement {
      occurredOn
      utcOffset
      isCumulative
      adSpend {
        amount
        currencyCode
      }
      clicksCount
      impressionsCount
      commentsCount
      favoritesCount
      unsubscribesCount
      complaintsCount
      failsCount
      sendsCount
      uniqueViewsCount
      uniqueClicksCount
      sharesCount
      viewsCount
      sessionsCount
      sales {
        amount
        currencyCode
      }
      orders
      firstTimeCustomers
      returningCustomers
      marketingActivity {
        id
      }
      channelHandle
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Response
JSON
{
  "marketingEngagementCreate": {
    "marketingEngagement": {
      "occurredOn": "2018-06-29",
      "utcOffset": "-07:00",
      "isCumulative": false,
      "adSpend": {
        "amount": "19.9",
        "currencyCode": "CAD"
      },
      "clicksCount": 40,
      "impressionsCount": 100,
      "commentsCount": 1,
      "favoritesCount": 0,
      "unsubscribesCount": 1,
      "complaintsCount": 1,
      "failsCount": 1,
      "sendsCount": 1,
      "uniqueViewsCount": 1,
      "uniqueClicksCount": 1,
      "sharesCount": 5,
      "viewsCount": 10,
      "sessionsCount": 40,
      "sales": {
        "amount": "304.5",
        "currencyCode": "CAD"
      },
      "orders": "8.0",
      "firstTimeCustomers": "5.0",
      "returningCustomers": "3.0",
      "marketingActivity": {
        "id": "gid://shopify/MarketingActivity/794355127"
      },
      "channelHandle": null
    },
    "userErrors": []
  }
}