Scenario: Segment visitors who wait too long
Scenario
You want to create a segment of visitors who are lingering too long on a page.
Summary of steps
- Use JavaScript to create a timerHasFired event tag to record when a timer fires.
- Deploy your event tag with your preferred tag manager.
- Create a segment that uses the event tag.
- Test your solution in Live Now.
Create a timerHasFired event tag
In your preferred code editor, create and validate a timerHasFired event tag.
Predictive Engagement tracking snippet
If you deployed the Predictive Engagement tracking snippet, use the following example to create a timerHasFired event tag.<script> ac('record', 'timerHasFired', {'timerName': 'gtm'});</script>
In the example:
- ac('record') is the function name.
- timerHasFired is your event tag.
- {'timerName':'gtm'} is a custom attribute.
For more information about the available Journey JavaScript methods you can use to create event tags, see the Journey JavaScript SDK.
Messenger snippet
If you are a Genesys Cloud CX customer and you deployed the Messenger snippet, use the following example to create a timerHasFired event tag.<script> Genesys("command", "Journey.record", { eventName: "timerHasFired", customAttributes: { timerName: “gtm” }, traitsMapper: [] });</script>
- Journey.record is the command.
- timerHasFired is your event tag.
- {timerName:gtm} is the custom attribute.
For more information about the available plugins and their associated commands and events, see Commands and events in the Genesys Cloud CX Developer Center.
Deploy the event tag
Deploy your event tag using your preferred tag manager:
- Adobe Launch
- Google Tag Manager (Predictive Engagement tracking snippet deployments only)
Create a Timerhasfired segment
- In Segments, under Visitor journey, click Add first activity.
- In the Attribute box, select Event name.
- In the Operator box, select equals.
- In the Value box, type the event name of your tag as you defined it in your ac('record') or Journey.record call.
- You must create a visitor journey attribute of the Event name type. Do not use the Custom attribute type.
- Genesys Predictive Engagement uses initial caps. If you created an event with the name timerHasFired, in the Value box, type Timerhasfired.
Test your solution in Live Now
- Open Live Now.
- Open your website.
- Start a visit and go to the page that you are tracking.
- Scroll to the bottom.
- Refresh Live Now and verify that a new visitor appears and that the visitor was added to the Timerhasfired segment.