Commercetools

Commercetools is a headless, API-first commerce platform that empowers businesses to build customizable, scalable, and flexible e-commerce solutions for seamless customer experiences.

The Dynamic Yield Commercetools integration automatically syncs product feeds from Commercetools to Dynamic Yield to ensure that product recommendations are pulled using the most accurate inventory levels, guaranteeing users an up-to-date shopping experience.

Step 1: Sync your product catalog with Dynamic Yield

A synced product feed enables capabilities like recommendations, segmenting based on product engagement, social proof tactics, and more.

You must enter your AWS S3 access and secret keys to enable the sync. To get these credentials:

In Experience OS:

  1. Go to Assets › Data Feeds, and click Add New › Product Feed.
    If you already have a product feed, edit it from the feeds view.

  2. Under Feed Source, select Sync a file via Amazon S3.

  3. Click Create a Bucket. The Access Key and Secret Key are displayed .

  4. Copy these credentials and paste them into the Commercetools app configuration.

Step 2: Create a custom application in Commercetools

First, install the Dynamic Yield app in your Commercetools store:

  1. In the Commercetools Merchant Center, go to Manage Organizations & Teams (from your initials in the top corner).

  2. Select your organization, and go to the Custom Applications tab.

  3. Click Configure Custom Applications.

  4. Click ➕ Add a Custom Application, and enter the following information:

    1. A name for the app.

    2. Any URL (this is a placeholder. You'll need to update it after the app is installed).

    3. An Application entry point URI path. Ensure it's the same as the one in the app installation (Connect). This value creates the application URL.

  5. Set permissions to view_key_value_documents and manage_key_value_documents (needed to read and update the form's configuration data in the app UI. See Custom Objects).

  6. Enter the default link label (the App name in the Merchant Center sidebar) (for example, Dynamic Yield Feed Sync), and then select a link icon:

  7. Click Register Custom Application. When the Custom Application is registered, copy and save the value of the Application ID.

Step 3: Generate the Client ID and Client Secret

🚧

Notes

  • CTP_CLIENT_ID and CTP_CLIENT_SECRET might already exist. If so, use these credentials.
  • You can see only one of these values at a time, so make sure to save them.
  1. Go to Developer Settings.

  2. Create an API client and name it (for example, Dynamic Yield API Client). Select Admin Client from the Scopes dropdown.

  3. Copy your client ID and secret and save them.

Step 4: Install the custom application

  1. In the Commercetools Merchant Center, go to Manage Organizations & Teams (from your initials in the top corner)

  2. Select your organization, then go to the Connect tab › Public Connectors.

  3. Search for Dynamic Yield by Mastercard, and then click Install.

  4. In the configuration area, select your region, then select the project for which you want to install the application. Click Next.

  5. Enter your client ID and secret (that you saved in the previous step).

  6. In the mc-app configuration area, enter the following information:

    • CTP_PROJECT_KEY: The project where you're installing the integration. For example, in the screen capture, this is dy-integration-test.
    • CUSTOM_APPLICATION_ID: Copied during registration in Step 2 .
    • CTP_REGION: For example, europe-west1.gcp.
    • ENTRY_POINT_URI_PATH: Use the URL path created in the registration process.
    • SERVICE_URL: Enter any URL. You'll need to update it after the first deployment).
  7. Click Install, and wait for the process to complete. This can take up to ~15 minutes.

When the installation is complete, the service and application URLs are created. You'll copy and save them in this next step, when you make necessary configuration changes:

  1. Go to the Connect tab › Manage Connectors › Installations, and click the latest installation.

  2. Click service and copy the URL.

  3. Click mc-app, and paste the URL in the Service URL field.

  4. Copy the URL in the mc-app tab and save it.

  5. Redeploy the app, and add the client ID and secret again in the service area. These are necessary for the app to save.

  6. Go back to the custom application and change the Application URL to the one generated during the installation. This is the URL you copied in step 4.

  7. Change the state to Ready, and then confirm the change.

Step 5: Sync your product feed

  1. Open the app from your sidebar, and enter the Dynamic Yield section ID to sync with.
  2. Enter your AWS S3 access key and secret key.
  3. Optionally, enter a parser function. See the next section for details.
  4. Click Sync The Entire Catalog Now.

🚧

The service server process has a timeout of 5 minutes, so if the product feed size is very large, the sync might fail. To make sure that the sync is succesful, insert the details and the product feed will sync with the job process as it has 30 minute server timeout. The automatic sync occurs every 4 hours.

Product feed columns

Mandatory columns

The following table lists the mandatory feed columns, and the recommended Commercetools attributes to sync to these columns. You can use these attributes that you sync in translations, recommendation strategies, targeting, and more.

Mandatory feed columnsCommercetools attributes (recommended)
skusku
group_idvariantId
namename
urlslug
image_urlimages
priceprices
categoriescategories
in_stockvariant.availability
descriptiondescription
keywordskey

Parser functions

Use a parser function to add to the JavaScript code additional fields to transform any information from a Commercetool Product Object into a flat CSV file that's generated periodically and synced to Dynamic Yield. When you enter the code in the parser function field, you can click Preview to download the file and see the results of your code.