Le marketing numérique et le PPC évoluent incroyablement rapidement. Cependant, pour toutes les innovations technologiques…
Soyez alerté lorsque des mots clés ou des groupes de produits dépensent trop
Les règles automatisées dans AdWords sont idéales pour configurer des alertes lorsque les choses dépensent trop sans convertir suffisamment. Mais malheureusement, ces règles automatisées ne peuvent être exécutées qu’une fois par jour, elles ne sont donc pas très utiles si vous souhaitez être averti dès qu’un mot-clé ou un groupe de produits dépasse vos seuils.
Voici donc un script simple qui interroge les mots clés ou les groupes de produits qui ont dépassé un montant de coût spécifique et qui ont moins d’un nombre spécifié de conversions à afficher pour ce coût.
Il envoie ensuite par e-mail la liste des alertes à l’utilisateur. L’e-mail peut inclure des liens profonds vers AdWords pour faciliter la tâche et résoudre les problèmes. Si les instructions pour les paramètres currentSetting.ID client, réglage actuel.effectiveUserId et currentSetting.ocid vous déroute, consultez un article précédent de Russ qui explique plus en détail les liens profonds vers les groupes d’annonces dans AdWords.
Merci à Fred Vallaeys pour ce script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
function main() { var currentSetting = new Object(); // what do you want to check? currentSetting.entityToCheck = "product groups"; // valid options: keywords, product groups // How much cost is allowed before we alert? currentSetting.maxCost = 1; // Fewer than how many conversions before we alert? currentSetting.MinConversions = 2; // who should get email alerts? currentSetting.emailsToNotify = ["example@example.com"]; // comma separated list, e.g. "example@example.com", "example2@example.com" // what date range do you want to check? currentSetting.dateRange = "TODAY"; // usually 'TODAY' // add links to help fix alerts by setting the following 3 values. // Load a page in your AdWords account and copy the numerical values for each of these these parameters currentSetting.customerId = '__c from the url'; // grab the URL from a page in your AW account and look for the numbers behind __c= currentSetting.effectiveUserId = '__u from the url'; // grab the URL from a page in your AW account and look for the numbers behind __u= currentSetting.ocid = 'ocid from the url'; // grab the URL from a page in your AW account and look for the numbers behind ocid= // --- Advanced users can change the AWQL queries used to find alerts --- var costToCheck = currentSetting.maxCost * 1000000; switch(currentSetting.entityToCheck) { case "keywords": currentSetting.reportType = "KEYWORDS_PERFORMANCE_REPORT"; currentSetting.metricsColumns = ['Criteria', 'CampaignName', 'CampaignId', 'AdGroupName', 'AdGroupId', 'Impressions', 'Clicks', 'Cost', 'CostPerConversion' ]; currentSetting.whereConditions = ['WHERE', 'Cost', '>=', costToCheck, 'AND', 'Conversions', '<', currentSetting.MinConversions ]; break; case "product groups": currentSetting.reportType = "PRODUCT_PARTITION_REPORT"; currentSetting.metricsColumns = ['ProductGroup', 'CampaignName', 'CampaignId', 'AdGroupName', 'AdGroupId', 'Impressions', 'Clicks', 'Cost', 'CostPerConversion' ]; currentSetting.whereConditions = ['WHERE', 'PartitionType', '=', 'UNIT', 'AND', 'Cost', '>=', costToCheck, 'AND', // cost is in micros so multiply the currency amount by 1,000,000, e.g. $1 -> 1000000 'Conversions', '<', currentSetting.MinConversions ]; break; } // --- Most people will not want to change the code after this --- var columnsUsedArray = currentSetting.metricsColumns; var columnsStr = currentSetting.metricsColumns.join(','); if(currentSetting.whereConditions.length > 0) { var whereClause = currentSetting.whereConditions.join(" "); } else { var whereClause = ''; } var reportText = "Alert for " + currentSetting.entityToCheck + " " + whereClause + "\n"; reportText += "During " + currentSetting.dateRange; reportText += "\nResults:\n"; // Pull the report with the options defined var query = 'SELECT ' + columnsStr + ' ' + 'FROM ' + currentSetting.reportType + ' ' + whereClause + ' ' + 'DURING ' + currentSetting.dateRange; //Logger.log("query: " + query); var report = AdWordsApp.report(query); var reportIterator = report.rows(); var numResults = 0; while(reportIterator.hasNext()){ var row = reportIterator.next(); numResults++; reportText += numResults + ". "; /* for(var i = 0; i < columnsUsedArray.length; i++){ var key = columnsUsedArray[i]; var data = row[key]; //Logger.log("data: " + data); //Logger.log(key + ": " + data); reportText += key + ": " + data + " | "; } */ switch(currentSetting.entityToCheck){ case 'keywords': reportText += row['Criteria'] + "(campaign: " + row['CampaignName'] + ") (ad group: " + row['AdGroupName'] + ")" var deepLink = "https://adwords.google.com/aw/keywords?campaignId=" + row['CampaignId'] + "&adGroupId=" + row['AdGroupId'] + "&channel=1" + "&ocid=" + currentSetting.ocid + "&__c=" + currentSetting.customerId + "&__u=" + currentSetting.effectiveUserId; break; case 'product groups': reportText += row['ProductGroup'] + " (campaign: " + row['CampaignName'] + ") (ad group: " + row['AdGroupName'] + ")" var deepLink = "https://adwords.google.com/aw/productgroups?campaignId=" + row['CampaignId'] + "&adGroupId=" + row['AdGroupId'] + "&channel=3" + "&ocid=" + currentSetting.ocid + "&__c=" + currentSetting.customerId + "&__u=" + currentSetting.effectiveUserId; break; } reportText += "\n" + deepLink; reportText += "\n"; } Logger.log(numResults + " matches found\n"); Logger.log(reportText); if(currentSetting.emailsToNotify) { sendEmailNotification("", currentSetting.emailsToNotify, numResults + " AdWords Alerts", reportText); } function sendEmailNotification(from, to, subject, body){ var remainingQuota = MailApp.getRemainingDailyQuota(); if(remainingQuota > to.length && to) { MailApp.sendEmail(to, subject, body) } } } |
Cet article comporte 0 commentaires