The Dynamic Yield – Magento Extension provides a quick and seamless integration with Dynamic Yield and enables an automatic implementation of Dynamic Yield’s eCommerce solution that includes:
- Dynamic Yield tracking script implementation
- Context API implementation
- eCommerce events implementation
- Product Feed (catalog) export
The Magento extension is compatible with both the Enterprise and the Community editions and supports the following event types:
- Purchase
- Add to cart
- Signup
- Login
- Newsletter subscription
- Add to wishlist
- Remove from cart
- Sort items
- Filter items
- Change attribute
- Promo code entered
- Search
Note: Bundled products are not supported and will not be migrated to Dynamic Yield.
Integration Requirements
The integration is built on some assumptions about your Magento environment. If any of the following assumptions are not true, speak to your Customer Success Manager to see if this method of implementation is supported for your environment.
- Your Magento site is built on one data feed that will map to one Dynamic Yield site. The site can manage one storefront, or multiple translations of the same storefront.
- There are less than 150,000 products in your product feed. If you have more products, you can disable the feed synchronization in Magento and upload a feed manually. For details, see Data Feeds.
- The store theme has not been heavily customized in such a way as to make the DOM element data difficult to access using JavaScript.
- The Magento core code has not been modified directly or extended incorrectly.
- If you are managing stock availability per locale using a plugin in Magento, your feed must be manually synchronized to Dynamic Yield. For details, see Data Feeds.
Mapping Store Views to Dynamic Yield Sites
By default, you connect your entire Magento site, including all Store Views, to a single Dynamic Yield site. If you have different Store Views that represent any case other than multiple translations of the same store, you need to link each Store View to a different Dynamic Yield site.
This will require manually sync a different product feed for each site using the standard procedure, and not using this integration. All other items (events, page context, and script), will be handled by this extension.
Notice: spaces in SKUs (e.g. SKU: 63 2) are replaced with underscores (e.g. SKU: 63_2).
To map a single store view to a Dynamic Yield site, when defining the Site ID field in the procedure below, define the relevant Store View using the drop-down at the top left of the screen. In the Site ID field, uncheck the Use Default option and specify the relevant Dynamic Yield site ID.
Installing the Magento Extension
- Download the extension files here.
- Unzip the folder and upload the extension folder to your root directory.
- Take precautions by following these 3 steps to make sure the process will run safe:
- Create a backup of your site by going into System › Tools › Backup or use solution that is provided by your hosting company. This will be useful if anything goes wrong.
- Disable compilations via System › Tools › Compilations.
- Clear cache by going into System › Cache Management.
- To activate the extension, log out from your admin panel and log back in again.
- To check the installation went fine, go to System › Configuration › Advanced and under disable modules output, check that your newly installed extension “DynamicYield_Integration” appears in the list. If it does, it means that you did everything correctly. Simply find the extension settings and start configuring.
Important Notes
- If Varnish or similar caching solution is used make sure that the Dynamic Yield blocks are not cached. In certain cases hole-punching might be necessary.
- If you are using a custom template and the template is using different html classes from default, you need to adjust those fields so the Dynamic Yield integration can work properly as shown in Advanced Settings below.
Configuration
- In the Magento admin panel, go to System › Configuration.
- Open the Dynamic Yield Integration › Configuration section.
- Click Integration Expand the Settings section and complete the form:
- In the Site ID section, enter your Dynamic Yield site ID.
- This is a store view level configuration, which means that it is possible to set different Site ID for each store view.
- Product feed uses default value and remains a global configuration.
- If you have multiple Store Views representing anything other than multiple translations of the same store, see Mapping Store Views to Dynamic Yield Sites above.
- In the Access Key ID, enter the value provided by your Customer Success Manager. This gives the extension access to your AWS S3 bucket. This configuration is global and therefore affects all stores and store views in this instance of Magento.
- Enter the Secret Access Key provided by your Customer Success Manager. This gives the AWS bucket access to the feed storage. This configuration is global and therefore affects all stores and store views in this instance of Magento.
- In the Site ID section, enter your Dynamic Yield site ID.
- Expand the Product Catalog Sync section and complete the following fields:
- Enable Product Feed Sync – This should be enabled, unless your feed is not standard and must be manually synchronized (see Integration Requirements above). If you disable the sync, you do not need to configure any of the other settings in this step.
- Sync rate – Sync rate configurations stands for Dynamic Yield export feed, how often you want it to be updated in Dynamic Yield service side.
- Product Attributes – Enhance your personalization capabilities by syncing up to 10 additional key product attributes (mandatory attributes are already selected). Note, you will not be able to deselect attributes after sync.
- Exclude Categories – Categories that will be excluded from the product feed column – “categories”. These categories will be reported in the column “keywords”. This is designed for categories that are temporary such as “winter sale”, which do not represent the main category tree but are still valuable. If excluded, these categories will still be reachable via the keywords column.
- Category Trees – Define root category for each store scope. Leave empty if all trees should be included in all store views
Advanced Settings
If you are using a custom template and the template is using different html classes from default, then you need to adjust those fields so the Dynamic Yield integration can work properly.
- Go to System › Configuration › Advanced › Developer in the admin panel.
- Expand the Dynamic Yield Integration section and adjust any of the following settings as desired:
- Load jQuery Library – Select “Yes” if you are using Magento 1.8 or earlier version and your site is not using jQuery library already in any other extension.
- Default Store – Select this option only if advised. You can select the default store to use for reporting categories in the context.
- Enable Custom Store Locale – Enable this to set a custom locale to be used in recommendation context. For more details, see Validating Multi-Language Sites below.
- Category Page Layered Navigation Filter – Set a custom trigger element and define type and value structure for the layered navigation filter.
- Category Page Sort Filter – Set a custom trigger element and define type and value structure for the sort filter.
- Product Page Swatch Filter – Set a custom trigger element and define type and value structure for the product swatch filter.
- Product Page Attribute Filter – Set a custom trigger element and define type and value structure for the product attribute filter.
- Debug Mode – Select “Yes” to enable a debug mode. The debug data will be written to a debug file {{base_dir}}/var/log/DynamicyieldIntegration.log.
- Product Feed Chunk Size – Select smaller value to use less CPU memory during product feed export. The default value is 100. Adjust only if you are having performance issues.
- Triggers – These configuration values expect a CSS selector (element, class, id) of the element that will trigger the action. An event listener is attached to this element. In case the DOM element is not found the event will not be attached and that particular event will not be tracked. To find the appropriate selector inspect the source code of the page and find the element that is responsible for triggering the filter/sort/change functionality. This can be any element (div/select/a/span). Usually just clicking on the element to inspect source is enough to find it, but sometimes it is more convenient to select the parent or child element.
- Type and Value – Once the trigger element is found the goal is to extract 2 values – type and value (filter type: Size, filter value: Green). To extract these we need to configure the Value and Type configuration fields. These fields show the DOM structure relative to the trigger element and are used to extract the type and value data. The structure (Type and Value) configs expect a JSON type string where keys are functions and values are function parameters. Any function that is available in the given scope can be used in the structure.
- Filter can have multiple types – attribute, text-based swatch, image-based swatch, etc.. Therefore there are multiple configuration values for each type. Depending on your requirements you have to fill out the necessary fields. If you do not use a particular type of filter you can leave the configuration as is or leave the field empty.
- Event Selector configuration is store scope so it is possible to set different selectors and structure for each store view.
- It is possible to configure the default store view that will be used in context. Use this option only if you have been instructed to do so.
- It is possible to configure the Integration Type. You will see following options:
- Enable Dynamic Yield Europe Account – Set this field to “Yes” to enable Dynamic Yield Europe account. This setting will adjust the tracking script urls and product feed upload url. No other configuration is necessary.
- Enable CDN integration – If you choose “Yes” or “European” an input field to write your own CDN url is shown (choose “Yes”). If “European” is chosen the product feed bucket endpoint url is changed.
- CDN url – You can write your custom CDN url that will be used to include the tracking scripts.
Validation
It is important to validate that your script, page context, data feed, and events have been set up properly. This is done using the Implementation Status Dashboard and the Web Implementation Helper.
See Validating Your Web Implementation for help with validation.
If you have multiple store fronts representing different translations of your site, see Validating Multi-Language Sites below. If you have any issues with the Purchase event, see Troubleshooting Purchase Events below. If you have cannot validate your Product Feed, see Troubleshooting your Product Feed below.
Validating Multi-Language Sites
If you have multiple store fronts representing different translations of your site, it is important to validate that the page context is properly aligned for each site. This is in addition to the standard page context validation procedure.
- Go to one of your websites and open the browser console.
- Locate the page context by searching for DY.recommendationContext.
- Verify that the lng parameter is aligned with the language of the page.
- Repeat this procedure for each translated version of your site.
- If you find one or more lng parameters that are not aligned with your site, you can update it in the the plugin settings.
- Go to System › Configuration › Advanced › Developer in the admin panel.
- Expand the Dynamic Yield Integration section.
- Set the Enable Custom Locate setting to true and use the drop-down list to select the correct language for the Store View that is currently selected. Repeat for every Store View.
- If the drop-down list does not have the correct language setting, set Set Custom Locate to true and specify the language string in the Custom Context Store Locale field (e.g. de_DE).
Troubleshooting Purchase Events
The integration uses default Magneto events which work for default Luma and built in modules. So if a 3rd party payment/checkout module is used you need to make sure that these events are triggered (or add observers to your custom events) during place order:
Magento1 – sales_order_place_after
Magento2 – checkout_onepage_controller_success_action
Troubleshooting Your Product Feed
If you could not successfully synchronize your product feed, use the following checklist to verify that all required settings are configured before contacting customer support.
- Verify that the Enable Product Feed Sync setting is enabled in Magento. For details, see Mapping Store Views to Dynamic Yield Sites above.
- Check the Site ID, Access Key and Secret Key settings and make sure they are correct.
- Verify that cron is running on your Magento site.
- Verify that the feed file is created on the server: {magento_root}/var/dyi_export/productfeed.csv
FAQs
Does the extension supports Varnish full page caching?
Yes, the extension works with Varnish full page caching. If Varnish or similar caching solution is used make sure that the Dynamic Yield blocks are not cached. In certain cases hole-punching might be necessary.
If I’m using 3rd party search extension, will the search event work?
In most cases yes, but if this extension is not following Magento default built in class hierarchy then please contact us so we can create custom solution for you.
Sort event is not working, what should I do?
If you are using custom template there may be some problems with Sort event as it is strictly made for default Magento templates. Please contact us to make a custom solution for you.
Change attribute event is not working, what should I do?
Extension is created to work with default Magento functionality in some cases customer are using 3rd party extensions for product page attributes. If so, please contact us so we can make a custom solution for you.
An event specified above is not working. What should I do?
Extension is created to do as less harm as possible to any other extension, but in some cases there may be some conflicts that can cause issues for some events or maybe even some other functionality of extension. If there is such situation, please contact us so our support team could evaluate and fix this kind of issue.
I’m getting a message “DynamicYield Integration: Products missing mandatory attributes. Details: dyi_skipped_products.log”:
Products are validated to make sure all of the mandatory attributes are set. If you are receiving this message – it means that there are products that were skipped during product feed export. The skipped products are listed in the dyi_skipped_products.log.