Improve cross-domain tracking and add "Always" script category

Move linker config into gtag('config') call with accept_incoming and
decorate_forms for reliable cross-domain linking. Capture _gl parameter
in sessionStorage to preserve attribution across navigation. Add
referrer-based attribution replay fallback so GA4 reports source/medium
instead of (not set) when UTMs are absent. Add "Always" script category
that executes without waiting for consent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 12:09:49 +00:00
parent 868ed867e2
commit 7059c45e20
5 changed files with 43 additions and 5 deletions

View File

@@ -82,11 +82,12 @@ $scripts = ATT_Consent_Scripts_Manager::get_all_scripts();
<th><label for="att-cc-script-category"><?php esc_html_e( 'Category', 'att-consent' ); ?></label></th>
<td>
<select id="att-cc-script-category" name="category">
<option value="always"><?php esc_html_e( 'Always', 'att-consent' ); ?></option>
<option value="functional"><?php esc_html_e( 'Functional', 'att-consent' ); ?></option>
<option value="analytics" selected><?php esc_html_e( 'Analytics', 'att-consent' ); ?></option>
<option value="marketing"><?php esc_html_e( 'Marketing', 'att-consent' ); ?></option>
</select>
<p class="description"><?php esc_html_e( 'The script will only execute after the visitor consents to this category.', 'att-consent' ); ?></p>
<p class="description"><?php esc_html_e( '"Always" scripts run on every page load without waiting for consent. Other categories execute only after the visitor consents.', 'att-consent' ); ?></p>
</td>
</tr>
<tr>