___INFO___ { "type": "TAG", "id": "cvt_temp_public_id", "version": 1, "securityGroups": [], "displayName": "DataNostro — Google Ads Enhanced Conversions", "description": "Sends user-provided data (email, phone, address) to Google Ads via Enhanced Conversions API. Improves match rate ~30% over click-only attribution.", "containerContexts": ["SERVER"] } ___TEMPLATE_PARAMETERS___ [ {"type": "TEXT","name": "conversion_id","displayName": "Conversion ID","simpleValueType": true,"valueValidators": [{"type":"NON_EMPTY"}]}, {"type": "TEXT","name": "conversion_label","displayName": "Conversion Label","simpleValueType": true,"valueValidators": [{"type":"NON_EMPTY"}]} ] ___SANDBOXED_JS_FOR_SERVER___ const sendHttpRequest = require("sendHttpRequest"); const getEventData = require("getEventData"); const sha256Sync = require("sha256Sync"); const url = "https://www.googleadservices.com/pagead/conversion/" + data.conversion_id + "/?label=" + data.conversion_label + "&value=" + (getEventData("value") || 0); const body = { user_identifiers: [ {hashed_email: sha256Sync((getEventData("user_data.email_address") || "").toLowerCase().trim(), {outputEncoding: "hex"})} ] }; sendHttpRequest(url, {method: "POST", headers: {"Content-Type": "application/json"}}, JSON.stringify(body)); data.gtmOnSuccess(); ___SERVER_PERMISSIONS___ [ {"instance": {"key": {"publicId": "send_http"}, "param": [{"key": "allowedUrls","value": {"type": 1,"string": "specific"}},{"key": "urls","value": {"type": 2,"listItem": [{"type": 1,"string": "https://www.googleadservices.com/*"}]}}]}} ] ___TESTS___ scenarios: [] ___NOTES___ Pair with the Google Ads Conversion Label and Customer ID from Ads UI.