googleads / adwords-scripts-linkchecker

App Engine-based link checker for AdWords Scripts and Apps Script
Apache License 2.0
11 stars 15 forks source link

Include 301 and 302 checks #4

Open gielAdformatic opened 7 years ago

gielAdformatic commented 7 years ago

Hi,

Is it possible to include a check for 301 and 302 response codes? I think this is useful since the are disapproved bij Google AdWords as well. I'm not experienced in Java, so I probably shouldn't do a pull request, but I believe the change should be in this file "UrlCheckerService.java" by changing 400 in row 70 to 300.

Would be great if this could be included. Would make this AdWords Script even better.

Best regards, Giel

garanj commented 7 years ago

Hi Giel, I believe 301 and 302 checks are in fact ok as long as the domain being redirected to remains the same: https://support.google.com/adwordspolicy/answer/6368661#672 Perhaps a check that compares the domain of the URL to be checked with the domain of the final response, and records an error if there is not a match between the domains?

Would that cover your use case?

gielAdformatic commented 7 years ago

Hi Garanj,

Yes, I believe that would be even better. No point in showing redirects Google is fine with. I just would like the script to recognize a policy violation, so I can prevent entities to be dissapproved.

This would be a great solution.