Skip to main content

Integrate Dotdigital Personalization with Magento 2

Connect your Magento store with our simple-to-install extensions.

There are two extensions that you should install to integrate your Magento site with our platform:

  • The Dotdigital Personalization extension
    Automatically add our script to your site and allow us to analyse your store and visitor data.

  • The W3C Digital Data Layer (DDL) extension
    Expose the store data you specify to our scripts.


1. Install the Dotdigital Personalization script

  1. In Magento, go to Stores > Configuration.

  2. Expand the Dotdigital Personalization section of the left side menu, and select Dotdigital Personalization script setup.

  3. Expand the Enable Dotdigital Personalization script drop-down menu and select Yes.

  4. For Website ID, enter your Dotdigital Personalization Account ID.
    To find this, in Personalization , select the Account menu icon in the bottom left.

  5. Expand the Region drop-down menu and select the region for your website. Choose from:

    • Region 1 (Europe)

    • Region 2 (North America)

    • Region 3 (Asia Pacific)

  6. Select Save Config.


2. Enable cart rebuild

  1. In Magento, expand the Dotdigital Personalization section of the left side menu and select Cart rebuild settings.
    Under Stores > Configuration.

  2. Expand the Cart rebuild redirect page drop-down menu and choose from:

    • cart
      Redirect customers to the cart page.

    • onepage
      Redirect customers to a one-page checkout.

    • custom
      Enter a custom URL to redirect customers to.
      You must not include a leading slash /.

  3. Select Save Config.


3. Configure the Digital Data Layer and product sync

Our Magento extension provides two ways to allow Dotdigital Personalization to access your product data.

The Digital Data Layer (DDL) exposes product details in a JavaScript object, allowing Dotdigital Personalization to capture these details through our script. Depending on the amount of data you chose to expose to the DDL, this can affect the performance of your site.

To mitigate this, you can also enable a background product data sync to import your product information into Dotdigital Personalization.

Enable product data sync

  1. In Magento, expand the Dotdigital Personalization section of the left side menu and select Product data sync setup.
    Under Stores > Configuration.

  2. Expand the Enable integration drop-down menu and select Yes.

  3. Copy the access token that’s generated for you.

  4. In Personalization, select the Account menu icon and go to Settings > Website settings > Magento settings.

  5. Paste the token you copied from Magento into the Access token field.

  6. Select Connect.

Once the connection between your Magento store and your Dotdigital Personalization account is established, you can control what product data is included in the sync. These settings are applied to both the background product data sync and the Digital Data Layer.

Learn more in the section Configure product data.

Enable Digital Data Layer

  1. In Magento, expand the Dotdigital Personalization section of the left side menu and select Digital Data Layer and product data settings.

    Under Stores > Configuration.

  2. Expand the Enable Digital Data Layer drop-down menu and choose from:

    • Minimal

    • Full
      Understand the difference in exposed data for each setting in the section Data scope for the DDL. To disable the Digital Data Layer, select No.

  3. Expand the Expose product data on all pages drop-down menu and choose from:

    • Yes
      Data is exposed to the DDL on every page of your website. This can increase page load times.

    • No
      Data is only exposed on the pages you specify.

      For Expose product data on selected pages, select the pages you want. Hold CTRL to select multiple pages. We recommend exposing on the following pages: Product Page, Basket Page, Checkout Page, and Checkout Success Page.

  4. If you want to expose product data on more pages, then for Custom product exposure, enter the layout handles for the pages you want. To specify multiple pages, use comma-separated values.

  5. If you want to expose transaction data on more pages, then for Custom purchase complete handling, enter the layout handles for the pages you want. To specify multiple pages, use comma-separated values.

  6. Expand the Enable user group exposure drop-down menu and choose from:

    • No
      Do not expose user group data.

    • Yes
      Expose the user group of the logged in user. This can be useful if you want to display different content to specific user groups.


Data scope for the DDL

Data point

Minimal

Full

generatedDate

✔️

✔️

page.category

✔️

✔️

page.pageInfo

✔️

✔️

pluginVersion

✔️

✔️

version

✔️

✔️

product.category

✔️

product.price

✔️

✔️

product.productInfo.attributes

✔️

product.productInfo.description

✔️

product.productInfo.productID

✔️

✔️

product.productInfo.productImage

✔️

product.productInfo.productName

✔️

✔️

product.productInfo.productThumbnail

✔️

product.productInfo.productURL

✔️

✔️

product.productInfo.rating

✔️

product.productInfo.ratingCount

✔️

product.productInfo.sku

✔️

✔️

product.productInfo.status

✔️

✔️

product.productInfo.stock

✔️

✔️

product.productInfo.visibility

✔️

✔️

product.linkedProduct

✔️

cart.cartID

✔️

✔️

cart.items.attributes

✔️

cart.items.category

✔️

cart.items.linkedProduct

✔️

cart.items.price

✔️

✔️

cart.items.productInfo

✔️

✔️

cart.items.quantity

✔️

✔️

user.profile.profileInfo.profileID

✔️

✔️

user.profile.profileInfo.segment.userGroupId

✔️

✔️

user.profile.profileInfo.segment.userGroup

✔️

✔️

user.profile.profileInfo.userFirstName

✔️

✔️

user.profile.profileInfo.userLastName

✔️

✔️

user.profile.profileInfo.email

✔️

✔️

user.profile.profileInfo.language

✔️

✔️

user.profile.profileInfo.returningStatus

✔️

✔️


Configure product data

The settings in this section of the connector allow you to configure what product data is exposed to the Digital Data Layer, and is included in the background product data sync.

  1. In Magento, expand the Dotdigital Personalization section of the left side menu and select Digital Data Layer and product data settings.
    Under Stores > Configuration.

  2. For Product attributes, select the custom attributes for your products that you want to expose to the DDL, and include in the product sync. Hold CTRL to select multiple attributes.

  3. Expand the Stock level data drop-down menu and choose from:

    • Don’t expose stock
      Don’t expose any stock data to the DDL, and do not syncs stock data as part of the background product sync.

    • Only expose in or out of stock
      Provide only the data to show if there is stock of a product or not.

    • Expose actual stock level
      Provide the specific number of items of stock for each product.

  4. Expand the Enable product ratings drop-down menu and select Yes or No. If enabled, average rating and number of ratings for each product is included in the sync and exposed to the DDL.

  5. Expand the Product list exposure type drop-down menu and choose from:

    • Simple
      Uses only already loaded product information.

    • Full
      Fetches products from the database to retrieve all data.
      This setting can significantly increase load times.

  6. Expand the Enable linked product exposure drop-down menu and select Yes or No. If enabled, linked product data for Configurable, Bundle and Grouped products is exposed and synced in the linkedProduct property of a product’s data.

  7. Expand the Enable parent product exposure drop-down menu and select Yes or No. If enabled, parent product data for Configurable, Bundle and Grouped products is exposed and synced in a product’s groupedParents and bundleParents properties.

  8. Once happy with your configuration, select Save Config.

Did this answer your question?