Add cross-domain tracking support (v1.2.0)
Add linker domains setting to Advanced tab for cross-domain measurement.
Outputs gtag('set','linker') before config call so GA4 appends the _gl
parameter to links pointing at configured domains.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -226,6 +226,18 @@ class ATT_Consent_Admin {
|
||||
if ( $settings['wait_for_update'] > 10000 ) {
|
||||
$settings['wait_for_update'] = 10000;
|
||||
}
|
||||
|
||||
// Cross-domain tracking: sanitize each domain line.
|
||||
$raw_domains = $_POST['cross_domain_domains'] ?? '';
|
||||
$lines = array_filter( array_map( 'trim', explode( "\n", $raw_domains ) ) );
|
||||
$clean = array();
|
||||
foreach ( $lines as $line ) {
|
||||
$domain = sanitize_text_field( $line );
|
||||
if ( '' !== $domain ) {
|
||||
$clean[] = $domain;
|
||||
}
|
||||
}
|
||||
$settings['cross_domain_domains'] = implode( "\n", $clean );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user