Inline prompts can be placed programmatically either in article content or above the site header. Prompts placed programmatically will be displayed to relevant readers on any page or article.
Prompts can also be placed manually in a specific place in article or page content using custom placements. Prompts assigned to a custom placement will only appear if its custom placement has been inserted manually somewhere.
Note: The Custom Placements system replaces the “Manual Placement” frequency and manual placement of prompts via shortcodes. Prompts with the “manual placement” frequency will be automatically reassigned to a custom placement instead, with the default “Until Dismissed” frequency. Prompts placed manually via shortcode will continue to work for legacy purposes, but we recommend replacing these with custom placement blocks to ensure that they continue being displayed in the future.
Assigning Prompts to Custom Placements
Every Newspack site comes with three custom placement slots by default. These custom placements can be inserted into any article or page using the Custom Placement block in the Gutenberg editor. To place prompts using custom placements:
- From the Newspack > Campaigns dashboard, create or edit a prompt in any segment. From the “Add New Prompt” menu, choose the “Custom Placement” option:
- In the editor sidebar, expand Prompt Settings. In the Placement dropdown, you’ll see options for Custom Placement 1-3. Note that these options will only be available if the prompt type is set to inline.
- Select one of the custom placements and save the prompt. This prompt will no longer be inserted programmatically anywhere on the site. Note that multiple prompts can be assigned to the same custom placement; this lets you display different prompts to different audience segments in the same place.
Adding Custom Placements to Articles and Pages
Prompts assigned to a custom placement are only displayed where manually added to article or page content. To display prompts assigned to a custom placement:
- Edit the post or page where you want the prompts to appear.
- Using the block inserter, insert a Newspack Campaigns: Custom Placement block (you can find it under the Newspack block category):
- Using the dropdown, select the custom placement whose prompts you want to display. If you do not choose a custom placement here, or the custom placement you choose doesn’t have any prompts assigned to it, the block won’t render anything.
- After selecting a custom placement, the editor preview will update to display a list of the currently active prompts assigned to that custom placement, grouped by segment in order of priority. Click on a prompt’s name to edit that prompt:
- Save the post or page. You can place the same custom placement in multiple posts or pages, and all instances of that custom placement will show the same prompts. If you change or deactivate the prompts assigned to a custom placement, all of its instances will be updated automatically.
What Happens When Readers View a Custom Placement
When readers visit a post or page containing a custom placement block, they may see one of the active prompts listed in the editor preview, if they match one of the segments shown.
Similarly to overlays and above-header prompts, each custom placement will display at most one prompt—the prompt with the reader’s highest-priority audience segment. Prompts assigned to a custom placement under the “Everyone” segment will only be displayed to readers who don’t match another segment.
For best results, you should assign no more than one prompt per segment to the same custom placement. If more than one active prompt is assigned to both the same segment and custom placement, a warning will be displayed in the Campaigns dashboard, and only the most recently created prompt will be displayed to readers:
- Assigning Prompts to Custom Placements
- Adding Custom Placements to Articles and Pages
- What Happens When Readers View a Custom Placement
Campaigns Table of Contents