URL Checker - Failure Strings

157 zobrazení
Preskočiť na prvú neprečítanú správu

Sven Edlefsen

neprečítané,
8. 2. 2022, 1:25:128. 2. 2022
komu: Google Ads Scripts Forum
Hi,

I've tried to use this script here https://developers.google.com/google-ads/scripts/docs/solutions/adsmanagerapp-link-checker to have any URLs flagged that have 4 products or fewer available.

For that I've set up the attached failure strings in the Google Sheets Document.

However, I wonder if this would also capture any products that just end with that string. So for example a URL where 23 products are available since it would still qualify for the "3 products" failure string.

I have also noticed that it flags pretty much any URL for the failure strings, for example the attached one where there are 79 products available.

Could someone please help me in identifying if I missed anything? Since we have thousands of ad groups this script could be a really good help in managing ad groups where stock has become low.

Thanks,
Sven
Google Ads URL Checker Script - Wrongly Flagged URL.JPG
Google Ads URL Checker Script - Failure Strings.JPG

Adwords Managerglobal

neprečítané,
8. 2. 2022, 5:50:038. 2. 2022
komu: Sven Edlefsen via Google Ads Scripts Forum
Hello Sven

This is new for me, I don't know about the Link checker, I need to review it in detail to understand all the things first.

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/28928169-3790-4e43-add5-b79e54c7a913n%40googlegroups.com.

Google Ads Scripts Forum Advisor

neprečítané,
9. 2. 2022, 3:30:289. 2. 2022
komu: adwords...@googlegroups.com
Hi Sven,

Thank you for reaching out to us.

With regard to your concern, the Link checker solution script utilizes Javascript's indexOf() method to check and compare the response content of your page and to the list of your failure strings. I've created a simple javascript and it is indeed that strings with "3 products" returns true when comparing to "23 products" string.  That said, you need to update your code and use the match() method instead.

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2W5G9i:ref

Sven Edlefsen

neprečítané,
9. 2. 2022, 5:52:299. 2. 2022
komu: Google Ads Scripts Forum
Thank you for your reply Teejay!

So does that mean I'd just have to change this bit:

      if (options.validCodes.indexOf(responseCode) !== -1) {

        if (options.useSimpleFailureStrings &&

            bodyContainsFailureStrings(response, options.failureStrings)) {

          responseCode = 'Failure string detected';

        } else if (options.useCustomValidation && !isValidResponse(url,

            response, options, entityDetails)) {

          responseCode = "Custom validation failed";

to this:

      if (options.validCodes.match(responseCode) !== -1) {

        if (options.useSimpleFailureStrings &&

            bodyContainsFailureStrings(response, options.failureStrings)) {

          responseCode = 'Failure string detected';

        } else if (options.useCustomValidation && !isValidResponse(url,

            response, options, entityDetails)) {

          responseCode = "Custom validation failed";

or do I just replace any iteration of "indexOf()" with "match()"?

Thanks,
Sven

Google Ads Scripts Forum Advisor

neprečítané,
10. 2. 2022, 2:23:5010. 2. 2022
komu: adwords...@googlegroups.com
Hi Sven,

Thank you for getting back to us. I've scrutinized the script and I believe that you need to update the bodyContainsFailureStrings functions. Could you kindly update your code below, then let me know how it goes?
 
function bodyContainsFailureStrings(response, failureStrings) {
    var contentText = response.getContentText() || '';
    // Whilst searching for each separate failure string across the body text
    // separately may not be the most efficient, it is simple, and tests suggest
    // it is not overly poor performance-wise.
    return failureStrings.some(function(failureString) {
      //return contentText.indexOf(failureString) !== -1;

      if ((contentText.match(failureString)) !== null) {
          return failureStrings;
      }


    });
  }

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 

 

ref:_00D1U1174p._5004Q2W5G9i:ref

Sven Edlefsen

neprečítané,
10. 2. 2022, 5:26:3710. 2. 2022
komu: Google Ads Scripts Forum
Hi Teejay,

I've just replaced the bodyContainsFailureStrings with the above code. However, after running it it still returns pages that have "11" products, "20 products" etc.

Thanks,
Sven

Google Ads Scripts Forum Advisor

neprečítané,
11. 2. 2022, 2:52:2111. 2. 2022
komu: adwords...@googlegroups.com
Hi Sven,

For us to have a closer look, could you please provide the following details via Reply privately to author option?
  • CID
  • Script Name
  • Shareable link of the spreadsheet being used in the script 
  • Sample data that I could test
In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscr...@google.com) instead, then let us know here once sent.

Sven Edlefsen

neprečítané,
11. 2. 2022, 5:06:0811. 2. 2022
komu: Google Ads Scripts Forum
Hi Teejay,

Thank you so much for your help! I don't seem to have the reply privately to author option so I've send an email just now.

Thanks,
Sven

On Friday, 11 February 2022 at 07:52:21 UTC adsscripts wrote:
Hi Sven,

For us to have a closer look, could you please provide the following details via Reply privately to author option?
  • CID
  • Script Name
  • Shareable link of the spreadsheet being used in the script 
  • Sample data that I could test
In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscripts-support@google.com) instead, then let us know here once sent.

Google Ads Scripts Forum Advisor

neprečítané,
15. 2. 2022, 2:48:3415. 2. 2022
komu: adwords...@googlegroups.com
Hi Sven,

Thank you for getting back to us.

As per a sample data, you may provide to us that fits to your use case sample with "3 products" returns true when comparing to "23 products" string. I'll be using this for testing and validation.
Odpovedať všetkým
Odpovedať autorovi
Poslať ďalej
0 nových správ