Dynamic Yield lets you skip making code changes to your website, using a Custom Code campaign template called Fire Event (available only for script implementation). Not only does it save you time, effort, and dev resources, but you can also limit it to fire only upon defined triggers (for example, hovering over an element or exit intent) and targeting conditions (for example, a user belongs to a specific audience or is using an iPhone).
To fire events based on the Fire Event template:
- Go to Web Personalization › Create Campaign and select a Custom Code (from the client-side campaigns).
- Specify the campaign settings, such as trigger, frequency, and advanced settings, and then click Next.
- Name your experience, and then click New Variation. From the template list, select Fire Event.
- Specify the Event Name. This is the name that is passed in the event.
- Save the variation.
Now, select a primary metric, set your targeting, and publish the experience as with any other campaign.
Because this template doesn't have any visible effect on your web page, you can test that everything works as expected by using the Implementation Helper and verifying that the custom event is logged there.
Note that the event isn't visible anywhere in the Experience OS console until it's triggered at least once.