This project is not covered by Drupal’s security advisory policy.

Personalized Paragraphs, in combination with the Smart Content & Paragraphs modules, provides the ability to personalize content for anonymous & authenticated visitors using Paragraphs.

For current users of Smart Content, you may have tried the Smart Content Block sub-module; you can think of Personalized Paragraphs as a port of Smart Content Block to Paragraphs. The clever UI designed by the authors of Smart Content Block is re-used in the context of Paragraphs.

Personalized Paragraphs depends on Smart Content, Paragraphs and Entity Usage.

Personalized Paragraphs has only been tested on Drupal 8.

Get Started:
There is a blog describing how to use Personalized Paragraphs here:
https://pierce-lamb.medium.com/how-to-use-personalized-paragraphs-559dd5...

How it was built
There is a blog describing how the module was built here:
https://pierce-lamb.medium.com/personalized-paragraphs-porting-smart-con...

Chat
There is a #personalized_paragraphs channel on the Drupal Slack Chat

Helpful Smart Content Modules:

  • Smart Content Datalayer collects data from Smart Content displayed on a page and provides it to analytics platforms like Google Tag Manager via the dataLayer object.
  • Smart Content A/B provides an A/B testing layer on top of Smart Content segments. You can use this directly for A vs B vs C tests, or intermix A/B conditions with more advanced personalization rules.
  • Smart Content UTM provides conditions for handling UTM strings. UTM values are automatically cookied and made available as conditions to use in segments.
  • Smart Content Demandbase is a connector module that allows data available through Demandbase’s API to be used as conditions. Note: this module requires an active Demandbase subscription.
  • Smart Content 6sense is a connector module that allows data available through 6sense's API to be used as conditions. Note: this module requires an active 6sense subscription.

Areas Ripe for Contribution:

  • Fixing the orphaned Decision problem
  • With more than 1 Personalized Paragraph on an Edit page, if remove/confirm removal is clicked on one, selecting a segment set on the other breaks
    • Similar to the ajax form issue described in the how it was built blog (ctrl+f 'digress') if you have more than one PP on an edit page and press 'confirm/confirm removal' on one, selecting a segment set on the other stops working. In Core's FormBuilder ->elementTriggeredScriptedSubmission() stops returning true on the correct element. It's as if once you press 'remove/confirm removal' on one PP, all other PP's 'Select Segment Set' buttons are removed from the page (at least in the eyes of Drupal's FormBuilder).
  • Test Personalized Paragraphs with multiple PPs in one Paragraph
    • The code has not been tested with more that one PP referenced in a paragraph, or a PP nested multiple references deep. There are a couple areas in the code where I call out that it might break in this scenario, for e.g. here and here
  • Adding back Reactions Add/Remove buttons
    • Version 1 removes the add/remove buttons from individual reactions (when you're configuring reactions) and instead just uses the value of the select dropdown when you submit. This limits the user to only one reaction per segment though it is nice and simple. The code that powers this from smart_content_block is still in PP, but commented out so it could be easily extended
  • function _has_personalized_paragraph
    • This function just feels like there may be a more 'Drupal-y' way to detect that a node contains a Personalized Paragraph. Current code here.
  • function getResponse performance
    • It feels like it may be possible to make this function more performant. My naive perf testing led me to believe that ->entityViewBuilder()->view() was the biggest culprit and I'm curious if there is a more performant way to generate a render array here
  • Drupal 9 testing

Areas for Future Development:

  • If a Reaction just referenced a Paragraph, would Paragraphs Library be needed? Imagine selecting your segment set, then for each Reaction, selecting the Paragraph Type and pressing 'Add Paragraph.' These sub-paragraphs would then have the personalized paragraph as a parent and perhaps we wouldn't need paragraphs to 'float free' as described in the How it was Built Blog. Relevant issue here

Supporting Organizations:
TIBCO

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Project categories: Content display
  • Ecosystem: Smart Content, Paragraphs
  • Created by plambie on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases