How to install the ProfitMetrics module in Magento 2

Follow these steps to install the ProfitMetrics module in Magento 2



Part 1: Download module

Part 2: Installation with Composer

Part 3: Installation with the module package

Part 4: Configuration


Part 1: Download Module

  1. Navigate to https://my.profitmetrics.io/customer/integrations_magento2.php

  2. Download the current version of the module
    step2

Part 2: Installation with composer

# In this example the magento 2 root is /var/www/magento2

$ cd /var/www/magento2/ $ composer config repositories.profitmetrics git https://pmgitforcomposer:9879c5c826b87d70075aea17bbde8b7965670614@github.com/Profitmetric s-io/profitmetrics-m2

$ composer require dv/profit-metrics

$ bin/magento setup:upgrade

$ bin/magento setup:di:compile

# Replace en_US with locales, used on Magento instance, Magento/luma with the theme used:

$ bin/magento setup:static-content:deploy en_US-f-a frontend--theme Magento/luma--jobs=4

$ bin/magento setup:static-content:deploy en_US-f-a adminhtml--jobs=4

$ bin/magento deploy:mode:set production--skip-compilation

$ bin/magento cache:enable

$ bin/magento cache:clean

$ bin/magento cache:flush

Part 3: Installation with the module package

  1. Connect to the Magento 2 server using any FTP client (FileZilla, etc).
  2. Upload the module to the Magento 2 root folder. The app/code/DV/ProfitMetrics folder should appear. Screenshot 2024-09-09 at 2.22.31 PM
  3. Connect to the Magento 2 server using an SSH client (Putty, etc).
  4. Run the following commands from the console:
    $ bin/magento deploy:mode:set default

    $ bin/magento setup:upgrade

    $ bin/magento setup:di:compile

    # Replace en_US with locales, used on Magento instance, Magento/luma with the theme used:

    $ bin/magento setup:static-content:deploy en_US-f-a frontend--theme Magento/luma--jobs=4

    $ bin/magento setup:static-content:deploy en_US-f-a adminhtml--jobs=4

    $ bin/magento deploy:mode:set production--skip-compilation

    $ bin/magento cache:enable

    $ bin/magento cache:clean

    $ bin/magento cache:flush

Part 4: Configuration

  1. Open the Magento 2 admin panel.
  2. Goto: Stores-> Configuration. Click on the DV EXTENSIONS tab, then click on ProfitMetrics.
    Screenshot 2024-09-09 at 2.24.41 PM
  3. Configure ProfitMetrics in the General tab:
    Screenshot 2024-09-09 at 2.25.55 PM
  4. Enable Is module enabled
    Store Public ID Store ID from ProfitMetrics > Websites
    Source for the configurable products price There are two options for configurable price determination: 
    1) get from the configurable product
    2) retrieve the minimal price of related simple options

    Price Buy Attribute Code Attribute code for price_buy 
    There is a default attribute created by this module called 'price_buy'
    Secret Code This code is required to secure access to feed data. Please generate the random value, save, and click generate
    Generate Random Secret Code This button will generate a random Secret Code for the field above
    Feed Filename Feeds are stored in the server in the path var/profitmetrics/products_.xml, where is the store code and is accessible by the URL:
    file path: magento_root/var/profitmetrics/products_default.xml
    URL: https://magento-2.com/profitmetrics/feed/index/code/0z8zpifbg2a04oo6wj0h/store/1

    Please select the specific file name in your store scope in order to modify the feed name for a specific store. Please find below the link to ProfitMetrics feed for the necessary store. The link should contain the correct secret code (please check the parameter value above). Please provide this link to ProfitMetrics team for products data synchronization.
    Generate Feed Now This button will generate a feed
    Order Statuses to send to ProfitMetrics This option allows selection of order statuses to send to ProfitMetrics
    "Send Orders Now" button This button allows sending order data to ProfitMetrics immediately
    "Script to include on all pages except for order confirmation" field Allows input of script to any page except Order Confirmation. Typically used for GA4 script
    3-Sep-09-2024-06-31-46-5536-PM
  5. Configure ProfitMetrics in the Cron tab
    Screenshot 2024-09-09 at 2.36.16 PM
  6. After configuration, go to System-> Cache Management-> Flush Magento Cache