Skip to main content

Migrate marketing activity extensions to Shopify CLI

If you have existing marketing activity extensions that were created and are managed through the Partner Dashboard, then you should migrate them to Shopify CLI.



Anchor to Step 1: Import your Marketing Activity extension locallyStep 1: Import your Marketing Activity extension locally

  1. Navigate to your app's directory.

  2. Run the following command:

    Terminal

    #!/bin/bash
    shopify app import-extensions
  3. Select Marketing Activity Extensions as the type of extension to import.

  4. Select an extension to import from the list.

    After completing the prompts, a TOML file is generated by importing your extension's existing configurations.


Anchor to Step 2: Verify your TOML fileStep 2: Verify your TOML file

Please review your TOML file to ensure the extension is configured properly. The following is an example of a TOML file that was generated for an imported marketing activity extension:

shopify.extension.toml

[[extensions]]
type = "marketing_activity"
name = "My Marketing Activity"
handle = "my-marketing-activity"
title = "Create a marketing ad"
description = "Creates an example marketing ad"
api_path = "/example"
tactic = "ad"
marketing_channel = "social"
referring_domain = "example.com"
is_automation = false

[[extensions.preview_data.types]]
label = "Desktop"
value = "desktop"

[[extensions.preview_data.types]]
label = "Mobile"
value = "mobile"

[[extensions.fields]]
name = "example_field"
heading = "Example Title"
body = "Example body"
ui_type = "paragraph"

The following table describes the properties in the TOML file that are specific to a Marketing activity extension:

PropertyDescription
[extensions]requiredSettings related to the template. Contains the following properties:
  • titlerequired : The title of the activity.
  • descriptionrequired : The description of the activity.
  • api_pathrequired: The API path of the hosted marketing activity endpoints. This is appended to the app's base URL.
  • tacticrequired : The tactic of the activity. Valid tactics are:
    • ad
    • abandoned_cart
    • affiliate
    • link
    • loyalty
    • message
    • newsletter
    • notification
    • post
    • retargeting
    • seo
    • storefront_app
    • transactional
  • marketing_channelrequired : The marketing channel of the activity. Valid marketing_channels are:
    • display
    • email
    • marketplace
    • referral
    • search
    • sms
    • social
  • referring_domain: The referring domain of which activity traffic is routed to the shop. If the marketing channel is email or sms, then the referring domain must be omitted.
  • is_automation: Whether the activity is a marketing automation. Marketing automations are ongoing activities that are triggered by an event or customer action (for example, an abandoned cart email, message, or notification).
[extension.preview_data.types]Types that are used with the preview endpoint. The defaults are desktop and mobile.
[extensions.fields]requiredThe fields used to define the marketing activity form that's displayed to merchants in the Shopify admin. For a complete reference on the available fields, refer to marketing activities components

Anchor to Step 3: Migrate your extensionStep 3: Migrate your extension

After you've imported the extension, you can migrate your extension by using Shopify CLI's deploy command.

Note

Deploying extensions using the app deploy command also publishes the extensions. We recommend testing changes by using app dev or deploying to a test app before deploying them to a production app.

Use Shopify CLI to deploy your extensions:

  1. Navigate to your app directory.

  2. Run the following command to start deploying your extensions:

    #!/bin/bash
    shopify app deploy
  3. Follow the prompts.

    When you receive confirmation that the deploy was successful, your extensions have been released.


Was this page helpful?