Resources

Installing Personalization for Drupal 9

Important

The instructions on this page are archived with the intention of assisting subscriptions troubleshooting the Lift module.

As of March 2023, Acquia recommends the Acquia Personalization module for applicable sites in all regions.

Requirements

As you prepare to use Personalization with your website, ensure you plan for the following requirements:

Component

Requirement

Drupal version

Drupal 9

PHP Dependency manager**

Composer (installation instructions)

Keys

After purchasing Personalization, Acquia will email you a group of keys required to connect to the Personalization service.

Installing the Personalization modules

Use the following steps to install the Personalization client on your website:

  1. Open a command prompt window, and then navigate to the directory containing your main composer.json file.

    Note for Cloud Platform users

    The main composer.json file is located in your website’s docroot directory.

  2. Run the following commands:

    composer config repositories.drupal composer https://packages.drupal.org/8
    composer update
    composer require drupal/acquia_lift:~4.0
    cd .. && git add --all && git commit -a -m 'Adding Personalization modules' && git push origin master
    
  3. Deploy the updated master to your website on Cloud Platform.

  4. Sign in to your website as an administrator, and then click Extend in the administrative menu.

  5. Select the checkboxes for the Personalization module.

  6. Click Install.

  7. In the administrative menu, click Configuration, and then click the Personalization link.

  8. Use the following steps to retrieve, and enter the information you need for the Personalization Credential section.

    1. Sign in to Personalization in a new browser tab, and then click the Configure tab.

    2. From the left menu, click the Customer Sites link.

    3. Click Add New Customer Site, specify the details for a new site, and save.

      Note

      Ensure that External ID is a machine-readable value.

    4. Go to the Personalize tab.

    5. From the left menu, click the Sites link and select the site that you just created.

    6. Retrieve the following values from the webpage:

      • Account ID

      • Site ID

      • Assets URL: For Personalization 4 users, use builder.lift.acquia.com.

      • Decision API URL

      • Authentication URL

      Important

      Each website must have a unique Site ID including development and testing environments. For more information, see per-environment configuration settings.

  9. Return to your website, and then update the values based on those from the Personalization interface.

  10. Click Save configuration.

Next, you must configure your per-environment configuration settings in your website’s settings.php file.

Per-environment configuration settings

Unless you specifically act, data collected by testing environments can contaminate data collected on your production environment.

To avoid data contamination, download this sample code, and install the code in your website’s settings.php file. Change the provided code to configure the variables associated with Personalization, and its components (including $config['acquia_lift.settings'], and $config['acquia_contenthub.admin_settings']) for different values depending on the environment in which they exist.

After you install all required modules, and ensure the modules are available for use, your production website can connect to the Personalization service. Your non-production website will not interfere with data collection for your production website.