Scenario: Engage visitors who scroll to the bottom of a page
Scenario
You created a webpage announcing a new product. You want to create a segment of those visitors who view the entire page and start an interaction with them.
Summary of steps
- Use JavaScript to create a ScrollToBottom event tag.
- Deploy your event tag with your preferred tag manager.
- Create a segment that uses the event tag.
- Create an action map to engage your visitors.
- Test your solution in Live Now.
Create a ScrollToBottom event tag
In your preferred code editor, develop and validate a ScrollToBottom event tag.
If you deployed the Predictive Engagement tracking snippet, use the following example to create a ScrollToBottom event tag.
<script>ac('dom', 'ready', function() { $(window).scroll(function(){ timeout = setTimeout( function() { if( $(window).scrollTop() + $(window).height() > $(document).height() - 100 ) { ac('record', 'scrollToBottom', 'User scrolled to bottom'); console.log('User scrolled to bottom'); } }) })})</script>
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 ScrollToBottom event tag.<script> Genesys("subscribe", "Journey.ready", function(){ $(window).scroll(function(){ timeout = setTimeout( function() { if( $(window).scrollTop() + $(window).height() > $(document).height() - 100 ) { Genesys("command", "Journey.record", { eventName: "scrollToBottom"}); console.log('User scrolled to bottom'); } } }})</script>
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 ScrollToBottom segment
- In Genesys Cloud CX Admin, create a segment.
- Under Visitor Journey, click Add first event.
- In the Session type box, click Web.
- In the Event Details box, click event action.
- In the Attribute box, click name.
- In the Operator box, click equals.
- In the Value box, type the name for your tag as you defined it in your ac('record') or
Journey.record
call and then click the checkmark.
Create a ScrollToBottom action map
- In Genesys Cloud CX Admin, create an action map.
- Name the action map ScrollToBottom.
- In the Select trigger section, click Segment match.
- Click Show details and then click Select segments.
- In the Select segments dialog box, select the ScrollToBottom segment.
- Configure the rest of the action map as needed and then save it.
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 ScrolltoBottom segment.