📜  adobe target triggerview - Javascript (1)

📅  最后修改于: 2023-12-03 14:39:02.573000             🧑  作者: Mango

Adobe Target TriggerView - Javascript

Adobe Target TriggerView is a Javascript API that allows you to dynamically update the page content based on your targeting rules defined in Adobe Target. It allows you to create personalized experiences for your users without modifying the HTML or CSS of the page.

TriggerView works by dynamically loading HTML fragments or components based on the targeting rules defined in Adobe Target. These components can be added or removed from the page based on the user's behavior, preferences or other criteria.

How it works

To use TriggerView in your web application, you need to include the Adobe Target Javascript library on your web page. You can download the library from Adobe Target's website, or include it directly from the CDN.

<!-- Adobe Target Javascript Library -->
<script src="//cdn.tt.omtrdc.net/cdn/target.js"></script>

Once you have included the Target Javascript library, you can use the TriggerView API to load personalized content onto your web page.

Using TriggerView

TriggerView API has two methods:

  • adobe.target.triggerView.load() - This method loads the personalized content based on the Targeting configuration.
  • adobe.target.triggerView.displayContent() - This method displays the loaded content on the web page.

Here is an example of how you can use these methods to dynamically load and display personalized content:

var params = {
   "mbox": "mypage",
   "params": {
        "category": "shoes"
    }
};

// Load personalized content
adobe.target.triggerView.load(params, function(content) {
    // Display content on the page
    adobe.target.triggerView.displayContent(content);
});

In this example, we are loading personalized content for a page called "mypage" with a category of "shoes". Once the content is loaded, we display it on the web page.

Conclusion

Adobe Target TriggerView API provides a powerful way to create personalized web experiences for your users without modifying the HTML or CSS of the page. By dynamically loading components based on user behavior or preferences, you can create a personalized experience that increases engagement, loyalty and revenue.