How to fix with a Django based website the AdSense: Earnings at risk - One or more of your sites does not have an ads.txt file ?

Daidalos June 09, 2019


Example of quickly fix with a django based web site the google Adsense warning message: "Earnings at risk - One or more of your sites does not have an ads.txt file". Just add the following url:

url(r'^ads\.txt$', views.authorized_digital_sellers_view, name='authorized_digital_sellers'),

and add the view:

def authorized_digital_sellers_view(request):
    return HttpResponse('google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0')

replace pub-0000000000000000 by your publisher id that can be found on the google adsense account in the menu: Account -> Account Information.

Note: It take about 24 hours to be taken into account.

References

Links Site
Earnings at risk - One or more of your sites does not have an ads.txt file. How To Fix ? support.google.com
How to Solve Earnings at risk – One or more of your ads.txt techtrickszone.com
Why am I getting an "AdSense alert: Earnings at risk" warning about ads.txt? dthrive.zendesk.com

Licence


Activity


Google Ads