__( 'TRACKING', 'agentic-commerce-for-woocommerce' ),
'title' => __( 'We check the pixel you already have', 'agentic-commerce-for-woocommerce' ),
'sub' => __( 'If you run Pixel Manager, PixelYourSite or a Tag Manager container, keep it. Installing a second pixel is how conversions get counted twice. We verify what is there and tell you what it is really doing.', 'agentic-commerce-for-woocommerce' ),
)
);
Xpay_UI::section(
__( 'What we found on your storefront', 'agentic-commerce-for-woocommerce' ),
__( 'Checked against your own home page. Cached for a few hours so this screen never waits on a network call.', 'agentic-commerce-for-woocommerce' ),
'' . esc_html__( 'Check again', 'agentic-commerce-for-woocommerce' ) . ''
);
echo '
';
Xpay_UI::check( $s['state'], $s['headline'], $s['detail'] );
// Our own pixel, beside what we detected. Off until a ChatGPT Ads pixel
// is linked, and recording-only when the check above finds another one.
$px = Xpay_ChatGPT_Pixel::status();
Xpay_UI::check( $px['state'], $px['headline'], $px['detail'], Xpay_Admin::url( '-ads' ), __( 'ChatGPT Ads', 'agentic-commerce-for-woocommerce' ) );
if ( $d['plugins'] ) {
Xpay_UI::check(
'pass',
__( 'Compatible tracking plugins detected', 'agentic-commerce-for-woocommerce' ),
sprintf(
/* translators: %s: plugin names. */
__( '%s. These work alongside this plugin — we read, we do not replace.', 'agentic-commerce-for-woocommerce' ),
implode( ', ', $d['plugins'] )
)
);
}
echo '
';
self::no_ads_truth();
self::local_measurement();
Xpay_UI::close();
}
/**
* The thing nobody else in this category will tell a merchant.
*
* @return void
*/
private static function no_ads_truth() {
Xpay_UI::section( __( 'Do you even need a pixel?', 'agentic-commerce-for-woocommerce' ) );
echo '';
echo '
' . esc_html__( 'If you are not running ChatGPT Ads: no', 'agentic-commerce-for-woocommerce' ) . '
';
echo '
' . esc_html__( 'A pixel only records what happens after somebody clicks one of your ads. With no ads running there is no click to attribute and nothing is reported. Appearing in ChatGPT organically comes from your catalog and product data instead — nothing on this screen affects it.', 'agentic-commerce-for-woocommerce' ) . '
';
echo '
' . esc_html__( 'If you are running them: verify, do not duplicate', 'agentic-commerce-for-woocommerce' ) . '
';
echo '
' . esc_html__( 'Keep the pixel you have and let us check it. Two pixels on one store means every purchase is counted twice, your reported returns look better than reality, and you find out only after you have scaled spend on a number that was never real.', 'agentic-commerce-for-woocommerce' ) . '
';
echo '
';
}
/**
* What we can measure with no pixel and no account at all.
*
* @return void
*/
private static function local_measurement() {
$d = Xpay_Local_Stats::attributed_orders( 30 );
$bots = Xpay_Local_Stats::bots( 30 );
Xpay_UI::section(
__( 'What we can tell you with no pixel at all', 'agentic-commerce-for-woocommerce' ),
__( 'Measured on your own server, from your own orders. No account, no credentials, nothing sent anywhere.', 'agentic-commerce-for-woocommerce' )
);
echo '';
Xpay_UI::stat(
__( 'AI assistant visits', 'agentic-commerce-for-woocommerce' ),
$bots['total'] ? number_format_i18n( $bots['total'] ) : '',
__( 'last 30 days, counted locally', 'agentic-commerce-for-woocommerce' ),
$bots['total'] ? 'pass' : 'low',
__( 'None yet', 'agentic-commerce-for-woocommerce' )
);
Xpay_UI::stat(
__( 'Orders traced to an assistant', 'agentic-commerce-for-woocommerce' ),
$d['orders'] ? number_format_i18n( $d['attributed'] ) : '',
null === $d['match_rate']
? __( 'no orders in this window', 'agentic-commerce-for-woocommerce' )
: sprintf( /* translators: %s: percent. */ __( '%s%% match rate', 'agentic-commerce-for-woocommerce' ), number_format_i18n( (float) $d['match_rate'], 1 ) ),
$d['attributed'] ? 'pass' : 'low',
__( 'No orders yet', 'agentic-commerce-for-woocommerce' )
);
echo '
';
echo '' . esc_html__( 'See the full breakdown by assistant →', 'agentic-commerce-for-woocommerce' ) . '
';
}
}