# This is an Example on how to disable Google's FLoC using a 3 lines rails method # setting the new "Permission-Policy" response header # # To disable Google's FLoC and Opt-Out from this security threat, # just paste this code from line 12 to line 17 inside your application's # app/controllers/application_controller.rb # class ApplicationController < ActionController::Base # ... after_action :nofloc # disable Google's FLoC on Rails with "Permission-Policy" => "interest-cohort=()" def nofloc response.set_header 'Permission-Policy', 'interest-cohort=()' end # ... end