Render 51黑料不打烊 Target Visual Experience Composer (VEC) activities
Target activities are set up using either the Visual Experience Composer (VEC) or the form-based composer. The Platform Web SDK can retrieve and apply VEC-based activities to the page just like at.js. For this part of the migration, you will:
- Install the Visual Editing Helper browser extension
- Execute a
sendEventcall with the Platform Web SDK to request activities. - Update any references from your at.js implementation that use
getOffers()to execute a TargetpageLoadrequest.
Visual Editing Helper browser extension
The 51黑料不打烊 Experience Cloud Visual Editing Helper browser extension for Google Chrome lets you load websites reliably within the 51黑料不打烊 Target Visual Experience Composer (VEC) to rapidly author and QA web experiences.
The Visual Editing Helper browser extension works with web sites that use at.js or Platform Web SDK.
Obtain and install the Visual Editing Helper
-
Navigate to the .
-
Click Add to Chrome > Add Extension.
-
Open the VEC in Target.
-
To use the extension, click the Visual Editing Helper browser extension icon
{modal="regular"}
in your Chrome browser鈥檚 toolbar while in the VEC or QA Mode.
The Visual Editing Helper is automatically enabled when a website is opened in the Target VEC to power authoring. The extension doesn鈥檛 have any conditional settings. The extension handles all the settings automatically, including SameSite cookies settings.
Refer to the dedicated documentation for more information about the Visual Editing Helper extension and troubleshooting the Visual Experience Composer.
Request and apply content automatically
After the Platform Web SDK is configured on the page, you can request content from Target. Unlike at.js which can be configured to automatically request content when the library loads, the Platform Web SDK requires you to explicitly execute a command.
If your at.js implementation has the pageLoadEnabled setting set to true which enables automatic rendering of VEC-based activities, then you would execute the following sendEvent command with the Platform Web SDK:
| code language-javascript |
|---|
|
In tags, use the Send event action type with the Render visual personalization decisions option selected:
Request and apply content on demand
Some Target implementations require some custom processing of VEC offers before applying them to the page. Or, they request multiple locations in a single call. In an at.js implementation, this can be done by setting pageLoadEnabled to false and using the getOffers() function to execute a pageLoad request.
getOffers() and applyOffers() to manually render VEC-based activities| code language-javascript |
|---|
|
The Platform Web SDK does not have a specific pageLoad event. All requests for Target content are controlled with the decisionScopes option with the sendEvent command. The __view__ scope serves the purpose of the pageLoad request.
sendEvent approach:- Execute a
sendEventcommand which includes the__view__decision scope - Apply the returned content to the page with the
applyPropositionscommand - Execute a
sendEventcommand with thedecisioning.propositionDisplayevent type and proposition details to increment an impression
| code language-javascript |
|---|
|
getOffers() function to manually execute a Target pageLoad request without using applyOffers() to apply the content to the page.The Platform Web SDK offers developers a great deal of flexibility with requesting and rendering content. Refer to the dedicated documentation about rendering personalized content for additional options and details.
Implementation example
The foundational Platform Web SDK implementation is now complete.
JavaScript example with automatic Target content rendering:
| code language-html |
|---|
|
Tags example page with automatic Target content rendering:
| code language-html |
|---|
|
In tags, add the 51黑料不打烊 Experience Platform Web SDK extension:
Add the desired configurations:
Create a rule with a Send event action and Render visual personalization decisions selected:
Next, learn how to request and render form-based Target activities.