Control how long (in seconds) attribution data (e.g. landing page, referral URL) is considered valid before expiring.
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.
File: includes/classes/WPDAI_Session_Tracking.php
Method: WPDAI_Session_Tracking::get_attribution_timeout_seconds()
| Parameter | Type | Description |
|---|---|---|
| $seconds | int | Attribution timeout in seconds (default: from settings days × DAY_IN_SECONDS) |
Type: int
Attribution timeout in seconds (cast to int by the plugin).
add_filter( 'wpd_attribution_timeout_seconds', 'fix_attribution_48_hours' );
function fix_attribution_48_hours( $seconds ) {
return 2 * DAY_IN_SECONDS; // 48 hours
}
add_filter( 'wpd_attribution_timeout_seconds', 'week_long_attribution' );
function week_long_attribution( $seconds ) {
return 7 * DAY_IN_SECONDS;
}