Enhanced Conversions | WordPress.org
Hi there, we are using the Google Listings & Ads plugin and it has generated a conversion tag on the checkout automatically, called “[4b4c] Google Listings and Ads purchase action”.
The options when setting up this tag are as follows:
We want to implement “Enhanced Conversions” with our conversion tag by sending hashed email and phone data on the conversion event.
We have made some code to send the hashed enhanced conversion data using the gtag event:
function add_google_ads_conversion_script($order_id) {
$order = wc_get_order($order_id);
if (!$order) {
return;
}
// Normalize and hash the email
$email = strtolower(trim($order->get_billing_email()));
$hashed_email = $email ? hash('sha256', $email) : '';
// Normalize and hash the phone number
$phone = $order->get_billing_phone();
$normalized_phone = $phone ? preg_replace('/\D/', '', $phone) : '';
$hashed_phone = $normalized_phone ? hash('sha256', $normalized_phone) : '';
?>
We’ve been running this script on our checkout however we are seeing that the conversion action
“needs attention” for the following reason:
Some of your enhanced conversions weren’t processed because no CSS selector or JavaScript variable for user-provided data was found or you didn’t provide user-provided data during setup.
We added logging to the php script above and there are no orders from any payment gateways that are not receiving the email data from the order and hashing it. So maybe customers scripts are being blocked by ad-block or browsers.
I have a few questions:
1 – Are there any guidelines for adding enhanced conversion to a conversion action generated through Google Listings and Ads or is the above correct?
2 – Is Google Listings & Ads dependent on Google Analytics for WooCommerce to provide the googletag script?
مشاهده پاسخ های این مطلب
---------------------------------------------
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس