Files
att-consent/admin/views/settings-advanced.php
Steve Hanlon 868ed867e2 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>
2026-03-04 13:33:30 +00:00

104 lines
3.9 KiB
PHP

<?php
/**
* Advanced settings tab.
*
* @package ATT_Consent
* @var array $settings Current settings.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
<?php wp_nonce_field( 'att_cc_save_settings' ); ?>
<input type="hidden" name="action" value="att_cc_save_settings">
<input type="hidden" name="att_cc_tab" value="advanced">
<table class="form-table">
<tr>
<th scope="row"><?php esc_html_e( 'URL Passthrough', 'att-consent' ); ?></th>
<td>
<label>
<input type="checkbox" name="url_passthrough" value="1" <?php checked( $settings['url_passthrough'] ); ?>>
<?php esc_html_e( 'Enable URL passthrough', 'att-consent' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'Passes ad click information (gclid, dclid) through URL parameters when navigating between pages, even before consent is granted. Recommended for better conversion attribution.', 'att-consent' ); ?>
</p>
</td>
</tr>
<tr>
<th scope="row"><?php esc_html_e( 'Ads Data Redaction', 'att-consent' ); ?></th>
<td>
<label>
<input type="checkbox" name="ads_data_redaction" value="1" <?php checked( $settings['ads_data_redaction'] ); ?>>
<?php esc_html_e( 'Enable ads data redaction', 'att-consent' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'When ad_storage is denied, redacts ad click identifiers sent in network requests. Provides additional privacy protection.', 'att-consent' ); ?>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="wait_for_update"><?php esc_html_e( 'Wait for Update (ms)', 'att-consent' ); ?></label>
</th>
<td>
<input type="number" name="wait_for_update" id="wait_for_update"
value="<?php echo esc_attr( $settings['wait_for_update'] ); ?>"
class="small-text" min="100" max="10000" step="100">
<p class="description">
<?php esc_html_e( 'How long Google tags wait for a consent update before firing with default (denied) state. 500ms is the recommended default. Only applies on first visit.', 'att-consent' ); ?>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="cross_domain_domains"><?php esc_html_e( 'Cross-Domain Tracking', 'att-consent' ); ?></label>
</th>
<td>
<textarea name="cross_domain_domains" id="cross_domain_domains" rows="4" class="large-text code"><?php echo esc_textarea( $settings['cross_domain_domains'] ); ?></textarea>
<p class="description">
<?php esc_html_e( 'Enter one domain per line for cross-domain measurement. The linker parameter will be appended to URLs pointing to these domains, allowing unified user tracking across sites.', 'att-consent' ); ?>
</p>
<p class="description">
<?php esc_html_e( 'Example: bookingengine.myguestdiary.com', 'att-consent' ); ?>
</p>
</td>
</tr>
</table>
<h2><?php esc_html_e( 'Google Consent Mode v2 Signal Reference', 'att-consent' ); ?></h2>
<table class="widefat fixed" style="max-width: 700px;">
<thead>
<tr>
<th><?php esc_html_e( 'Consent Category', 'att-consent' ); ?></th>
<th><?php esc_html_e( 'Google Consent Signals', 'att-consent' ); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><?php esc_html_e( 'Necessary', 'att-consent' ); ?></strong></td>
<td><code>security_storage</code> <?php esc_html_e( '(always granted)', 'att-consent' ); ?></td>
</tr>
<tr>
<td><strong><?php esc_html_e( 'Functional', 'att-consent' ); ?></strong></td>
<td><code>functionality_storage</code>, <code>personalization_storage</code></td>
</tr>
<tr>
<td><strong><?php esc_html_e( 'Analytics', 'att-consent' ); ?></strong></td>
<td><code>analytics_storage</code></td>
</tr>
<tr>
<td><strong><?php esc_html_e( 'Marketing', 'att-consent' ); ?></strong></td>
<td><code>ad_storage</code>, <code>ad_user_data</code>, <code>ad_personalization</code></td>
</tr>
</tbody>
</table>
<?php submit_button(); ?>
</form>