Filter: wpd_attribution_timeout_seconds
Control how long (in seconds) attribution data (e.g. landing page, referral URL) is considered valid before expiring.
Description
Attribution timeout is separate from session timeout. It defines the window during which a stored landing page or referral URL is still used for attribution (e.g. first-touch). The plugin derives the default from settings (attribution_timeout_in_days). This filter overrides the resulting value in seconds.
Location
File: includes/classes/WPDAI_Session_Tracking.php
Method: WPDAI_Session_Tracking::get_attribution_timeout_seconds()
Parameters
| Parameter | Type | Description |
|---|---|---|
| $seconds | int | Attribution timeout in seconds (default: from settings days × DAY_IN_SECONDS) |
Return
Type: int
Attribution timeout in seconds (cast to int by the plugin).
Example Usage
Fix attribution window to 48 hours
add_filter( 'wpd_attribution_timeout_seconds', 'fix_attribution_48_hours' );
function fix_attribution_48_hours( $seconds ) {
return 2 * DAY_IN_SECONDS; // 48 hours
}
Use 7 days for attribution
add_filter( 'wpd_attribution_timeout_seconds', 'week_long_attribution' );
function week_long_attribution( $seconds ) {
return 7 * DAY_IN_SECONDS;
}
Related Filters
- wpd_session_timeout_seconds – Session inactivity timeout