How to show a different video to your segments

The personalization area in RightMessage can be used to change what video a segment views.

Unfortunately it's not possible to simply select the iframe or embed element and change the URL of the video. In these cases you would need to manually select the element the video is embedded in using the ‘Affected Elements’ options of the personalization editing tool.

In this article we will show you how to use the RightMessage personalization tool to add a custom selector and use the text editing area to add the new video embed code.

This article covers how to change a YouTube video on a WordPress website that has been embedded using the Gutenberg editor. 

There are many ways a video can be embedded on a website, so this article may not fit your situation exactly. Use the concepts shown in this article to adjust your own videos, but if your scenario is more complicated than what is shown, please  contact the support team for assistance.

1. Select any element on the page

In the campaign editor, we will need to display the personalization editing tool in order to add a custom selector for the video embed area on our website.

To display the personalization editing tool, highlight and click on any element on the page. Select to personalize the element.

2. Change the 'Affected Elements' selector

In the personalization editing tool, click on the ‘Affected Elements’ tab.

In the available options, click on the ‘view / customize selector (advanced)’ button.

A field will display with the selector of the element we highlighted pre-populated in the field. 

Place your cursor in the field and delete the pre-populated selector. Paste the selector for your video embed area into the field.

If you have embedded a video in WordPress using the Gutenberg editor, the selector you may want to use is:

		.is-type-video .wp-block-embed__wrapper
	

The personalization tool will confirm if an element matches the selector you have added, and the website preview pane will highlight the area of that selector.

Click ‘Done’ under the selector field to confirm the new selector being personalized.

3. Paste the new Embed code into the text editor

The ‘Modify’ settings tab in the personalization editing area will provide options to paste in the new video embed code.

In the text editing tool, select the '<>' icon to add the video HTML embed code.

To change the video, you will need code that uses <embed></embed> or <iframe></iframe>. The text editor will not display the new video based on a URL.

Paste the new video embed code into the editor.

Click the '<>' icon again to return to the visual editor. The video will display in the the text editing area.

4. Publish the personalization(s)

Click the ‘Publish’ button to save the changes.

Using the  instructions for viewing a website as a subscriber, you can view the personalization changes.

Examples of embed code to use

Below are examples of the embed code to use for YouTube, Wistia and Vimeo.

Still need help? Contact Us Contact Us