Expand my Community achievements bar.

SOLVED

Can we use Adobe Target to target on visitor's real-time visiting behavior including their "current staying time longer than xx mins" as triggering criteria?

Avatar

Level 2

I know we can set a audience segment in AA filtering visitor behavior in the past, when they come back again on the website and their previous behavior meet the segment setting, we provide them with different experience using Adobe Target.

But can we also add criteria that contains their real-time visiting behavior such as " browsed more than 1.5 minutes on certain page within this current visit", and "more than 3 pages already during this current visit".

Which means we need a rea-time timer set on the current visit for certain group of audience segment beyond their historical behavior.

Is that applicable?

Thank you

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

This is absolutely achievable. You can do this by creating a profile script that counts how long the visit time is on the site. 

 

Disclaimer
I'm not a developer, but a huge fan of chatGPT when it comes to getting a good start for how a profile script can look. I've not tested or reviewed it in details. chatGPT generated this.

 

(function() {
    // Check if the 'visitDuration' variable is already defined in the profile
    if (typeof user.get('visitDuration') === 'undefined') {
        // Initialize the 'visitDuration' profile attribute
        user.set('visitDuration', 0);
        // Set the 'startTime' when the user first visits the page
        user.set('startTime', new Date().getTime());
    } else {
        // Calculate the current duration
        var currentTime = new Date().getTime();
        var startTime = user.get('startTime');
        var duration = (currentTime - startTime) / 1000; // Convert milliseconds to seconds

        // Update the 'visitDuration' profile attribute
        user.set('visitDuration', duration);

        // Check if the duration exceeds 90 seconds
        if (duration >= 90) {
            // Set a custom attribute to indicate the visitor has stayed for 90 seconds
            user.set('stayed90Seconds', true);
        }
    }
})();

 

Explanation:

 

1. Initialization: The script first checks if the visitDuration profile attribute is already defined. If not, it initializes it and sets the startTime to the current time when the user first visits the page.

2. Duration Calculation: On subsequent checks, it calculates the current duration by comparing the current time to the startTime.

3. Update Profile: The visitDuration profile attribute is updated with the current duration.

4. Trigger Condition: If the duration exceeds 90 seconds, it sets a custom attribute stayed90Seconds to true.

 

 

When creating a segment, under Visitor Profile you'll now see your profile script and the user.stayed90Seconds option, allowing you to create a segment based on visitors staying more than 90 seconds on the website, which is evaluated in real-time.

It can be expanded or combined with other attributes/profile scripts, so you also include the visit number for the visitor.

I hope this helps!

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

This is absolutely achievable. You can do this by creating a profile script that counts how long the visit time is on the site. 

 

Disclaimer
I'm not a developer, but a huge fan of chatGPT when it comes to getting a good start for how a profile script can look. I've not tested or reviewed it in details. chatGPT generated this.

 

(function() {
    // Check if the 'visitDuration' variable is already defined in the profile
    if (typeof user.get('visitDuration') === 'undefined') {
        // Initialize the 'visitDuration' profile attribute
        user.set('visitDuration', 0);
        // Set the 'startTime' when the user first visits the page
        user.set('startTime', new Date().getTime());
    } else {
        // Calculate the current duration
        var currentTime = new Date().getTime();
        var startTime = user.get('startTime');
        var duration = (currentTime - startTime) / 1000; // Convert milliseconds to seconds

        // Update the 'visitDuration' profile attribute
        user.set('visitDuration', duration);

        // Check if the duration exceeds 90 seconds
        if (duration >= 90) {
            // Set a custom attribute to indicate the visitor has stayed for 90 seconds
            user.set('stayed90Seconds', true);
        }
    }
})();

 

Explanation:

 

1. Initialization: The script first checks if the visitDuration profile attribute is already defined. If not, it initializes it and sets the startTime to the current time when the user first visits the page.

2. Duration Calculation: On subsequent checks, it calculates the current duration by comparing the current time to the startTime.

3. Update Profile: The visitDuration profile attribute is updated with the current duration.

4. Trigger Condition: If the duration exceeds 90 seconds, it sets a custom attribute stayed90Seconds to true.

 

 

When creating a segment, under Visitor Profile you'll now see your profile script and the user.stayed90Seconds option, allowing you to create a segment based on visitors staying more than 90 seconds on the website, which is evaluated in real-time.

It can be expanded or combined with other attributes/profile scripts, so you also include the visit number for the visitor.

I hope this helps!