I need to create a function on which will record the 'Total Order value' on my order confirmation page in woocommerce, the function will be be used by microsoft ads to record the value of order against what i have spent, anybody any experience of doing this?

The code provided by microsoft is:

window.uetq.push('event', '', {'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'Replace_with_Currency_Code'});

So i need to create a function called 'revenue_value' for example which will pass the total order value to the above code. Anybody point me the right direction.

I am trying to create a template from postman by sending this object:

{     "name": "listado_productos",     "language": "es",     "category": "TRANSACTIONAL",     "components": [         {             "type" : "HEADER",             "format": "document",             "example": {                 "header_handle": [                     "https://drive.google.com/file/d/1CcTpDZL3p0ltMFhIKU9Vhz1LWG0bQFpN/view?usp=share_link"                 ]}         },         {             "type": "BODY",             "text": "Buenas tardes, acá le enviamos el nuevo listado de precios. Muchas gracias"         },         {             "type": "FOOTER",             "text": "ABS."         }     ] } 

If I try an example from the official business-management-api guide, it also rejects it for non-compliance with terms and conditions.

"name": "promotional_message",   "language": "en_US",   "category": "TRANSACTIONAL",   "components": [{            "type":"BODY",            "text":"Hi {{1}}, get an extra 10% off every order above $300.",            "example":{"body_text":[["Sonia"]]}          },          {            "type":"HEADER",            "format":"TEXT",            "text": "Bonus Tuesday starts now!"          },          {            "type":"FOOTER",            "text":"Not interested? Tap Stop promotions"          },          {            "type":"BUTTONS",            "buttons":[{"type":"QUICK_REPLY", "text": "Shop now"},             {"type":"QUICK_REPLY", "text": "Stop promotions"}]          }]   

The response is that it is rejected for being duplicate or not complying with WhatsApp Busiess Api terms and services but it is not true, I read the terms and conditions and the file / message format complies. Does anyone identify the problem?

Hi I am trying to write a script that will extract the data from Google Ads Report (Call Details) or 'call_metrics_call_details_report' to a spreadsheet automatically. I have been able to extract all the details successfully - except for the caller phone number. There also does not seem to be a google attribute for this. Can anybody help? Thank you

function importCallDetails() {   var accountId = AdWordsApp.currentAccount().getCustomerId();   var startDate = "INSERT_START_DATE_HERE";   var endDate = "INSERT_END_DATE_HERE";   var query = "SELECT CallStartTime, CallDuration, CallerCountryCallingCode, CampaignName,     CampaignId " + "FROM CALL_METRICS_CALL_DETAILS_REPORT";   var report = AdsApp.report(query);   var data = report.rows();   var spreadsheetUrl = 'https://docs.google.com/spreadsheets/*********/';   var spreadsheet = SpreadsheetApp.openByUrl(spreadsheetUrl);   var ss = spreadsheet.getSheetByName('PAGE1');   ss.clearContents();   report.exportToSheet(ss); }   function main() {   importCallDetails(); } 

I have a problem with my nodejs code and the connection to the official whatsapp business api.

The bot connects the webhook correctly, the messages arrive to the server correctly but the code I have implemented to make it respond is not being effective, I checked the code from top to bottom but I can't find the fault.

I leave you the codes so you have more context:

whatsappController.js:

const fs = require("fs"); const myConsole = new console.Console(fs.createWriteStream("./logs.txt")); const whatsappService = require("../services/whatsappService") const VerifyToken = (req, res) => {     try {         var accessToken = "456E7GR****************************";         var token = req.query["hub.verify_token"];         var challenge = req.query["hub.challenge"];         if(challenge != null && token != null && token == accessToken){             res.send(challenge);         }         else{             res.status(400).send();         }     } catch(e) {         res.status(400).send();     } } const ReceivedMessage = (req, res) => {     try {         var entry = (req.body["entry"])[0];         var changes = (entry["changes"])[0];         var value = changes["value"];         var messageObject = value["messages"];         if(typeof messageObject != "undefined"){             var messages = messageObject[0];             var text = GetTextUser(messages);             var number = messages["from"];             myConsole.log("Message: " + text + " from: " + number);             whatsappService.SendMessageWhatsApp("The user say: " + text, number);                          myConsole.log(messages);             myConsole.log(messageObject);         }         res.send("EVENT_RECEIVED");     }catch(e) {         myConsole.log(e);         res.send("EVENT_RECEIVED");     } } function GetTextUser(messages){     var text = "";     var typeMessage = messages["type"];     if(typeMessage == "text"){         text = (messages["text"])["body"];     }     else if(typeMessage == "interactive"){         var interactiveObject = messages["interactive"];         var typeInteractive = interactiveObject["type"];         if(typeInteractive == "button_reply"){             text = (interactiveObject["button_reply"])["title"];         }         else if(typeInteractive == "list_reply"){             text = (interactiveObject["list_reply"])["title"];         }else{             myConsole.log("sin mensaje");         }     }else{         myConsole.log("sin mensaje");     }     return text; } module.exports = {     VerifyToken,     ReceivedMessage } 

The second file is whatsappService which I make the connection with the api using the token and I also send the format of the message I want to send when I receive a hello for example...

const https = require("https"); function SendMessageWhatsApp(textResponse, number){     const data = JSON.stringify({         "messaging_product": "whatsapp",             "recipient_type": "individual",         "to": number,         "type": "text",         "text": {             "preview_url": false,             "body": textResponse         }     });     const options = {         host:"graph.facebook.com",         path:"/v15.0/1119744*************/messages",         method:"POST",         body:data,         headers: {             "Content-Type":"application/json",             Authorization:"Bearer EAAWNbICfuWEBAK5ObPbD******************************************************"         }     };     const req = https.request(options, res => {         res.on("data", d=> {             process.stdout.write(d);         });     });     req.on("error", error => {         console.error(error);     });     req.write(data);     req.end(); } module.exports = {     SendMessageWhatsApp }; 

Then I declare the routes for the get (to check token) and post (to receive and reply to messages) methods:

const expres = require("express"); const router = expres.Router(); const whatsappController = require("../controllers/whatsappControllers"); router .get("/", whatsappController.VerifyToken) .post("/", whatsappController.ReceivedMessage) module.exports = router; 

Last but not least the index file for the code to run correctly:

const express = require("express"); const apiRoute = require("./routes/routes"); const app = express(); const PORT = process.env.PORT || 3000 app.use(express.json()); app.use("/whatsapp", apiRoute); app.listen(PORT, () => (console.log("El puerto es: " + PORT))); 

I should clarify that I did the tests with Postman and they were all successful, it responds and receives messages correctly, finally I did the tests by uploading the bot to the Azure service and it works without problem until it has to answer/replicate the user's message.

The bot is not responding to the user when he talks to it but everything arrives correctly to the server and it processes it with a 200 response. I attach the evidence that there is no problem in the reception.

Finally I must say that in the meta platform I have everything configured as specified by the same platform, I have already configured the api to answer the messages through the webhooks and everything is correct, I just can't get the bot to answer correctly.

The bot is hosted in the Azure service.

I wanna get out campaigns reports using Google Rest API and it does'nt work in Google ads Apps script.

My code:

function main() {    const API_VERSION = "12"; const CUSTOMER_ID = "***"; //contais real custommer ID const DEVELOPER_TOKEN = "***"; //contais real developper ID const MANAGER_CUSTOMER_ID = "***"; //contais real manager ID const OAUTH2_ACCESS_TOKEN = ""; //contais real ACCES TOKEN const data = {   "pageSize": 10000,   "query": "SELECT ad_group_criterion.keyword.text, ad_group_criterion.status FROM ad_group_criterion WHERE ad_group_criterion.type = 'KEYWORD' AND ad_group_criterion.status = 'ENABLED'" }; const url = `https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:search`; const options = {   method: "POST",   headers: {     "Content-Type": "application/json",     "developer-token": DEVELOPER_TOKEN,     "login-customer-id": MANAGER_CUSTOMER_ID,     "Authorization": `Bearer ${OAUTH2_ACCESS_TOKEN}`   },   body:  JSON.stringify(data),    "muteHttpExceptions": true }; Logger.log(UrlFetchApp.fetch(url, options)); } 

Result error: { "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure", "errors": [ { "errorCode": { "queryError": "UNEXPECTED_END_OF_QUERY" }, "message": "Error in query: unexpected end of query." } ], "requestId": "zKBR9-dJoG9NWAx3iJea2g" } ] } }

But query is valid https://developers.google.com/google-ads/api/fields/v11/query_validator enter image description here

Could you plese help?

Thanks

I wanna get out campaigns reports using Google Rest API and it does'nt work. My code and result is above.