Shahi LegalFlowSuite

How to Configure Geo-Targeting for Compliance

Overview

This guide explains how to set up geo-targeting so the correct compliance template is automatically shown to users based on their location.

Why Geo-Targeting?

    1. EU Visitors → See GDPR-compliant banner
    2. California Visitors → See CCPA template
    3. Brazil Visitors → See LGPD template
    4. Other Regions → See simple template or your choice
    5. Automatic → No manual configuration per visitor
    6. Prerequisites

    7. Consent Management module enabled
    8. Banner already configured
    9. Admin access
    10. How Geo-Detection Works

      Server-Side Detection (Primary)

    11. Visitor IP address detected
    12. Geo_Service looks up IP location
    13. Returns country/region
    14. GeoRuleMatcher finds matching rule
    15. Correct template determined
    16. Frontend Fallback (Secondary)

    17. If server-side fails, uses API
    18. /wp-json/slos/v1/geo/region endpoint
    19. Browser sends visitor IP
    20. Returns detected region
    21. JavaScript selects template
    22. Multi-Layer Fallback

    23. Server detection
    24. API detection
    25. Region mapping
    26. Default template
    27. Step 1: Enable Geo-Targeting

    28. Go to SLOSConsent Management
    29. Click Settings tab
    30. Scroll to Geo-Targeting
    31. Check “Enable Geo-Targeting”
    32. Click Save Changes
    33. Step 2: Set Up Geo Rules

      EU (GDPR) Rule

      Location: Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden

    34. Go to Consent ManagementGeo Rules
    35. Click Add Rule
    36. Rule Name: “GDPR – EU”
    37. Countries: Select all EU countries (or bulk select “EU”)
    38. Template: Select “GDPR Template”
    39. Set Effective: Immediately
    40. Set Priority: High (executed first)
    41. Click Save Rule
    42. California (CCPA) Rule

      Location: United States – California

    43. Click Add Rule
    44. Rule Name: “CCPA – California”
    45. Countries: United States
    46. States/Provinces: California
    47. Template: Select “CCPA Template”
    48. Priority: High
    49. Click Save Rule
    50. Brazil (LGPD) Rule

      Location: Brazil

    51. Click Add Rule
    52. Rule Name: “LGPD – Brazil”
    53. Countries: Brazil
    54. Template: Select “LGPD Template” (or Advanced)
    55. Priority: High
    56. Click Save Rule
    57. Default Rule

      For all other locations:

    58. Click Add Rule
    59. Rule Name: “Default Template”
    60. Countries: All others
    61. Template: Select “Simple Template”
    62. Priority: Low (lowest priority)
    63. Click Save Rule
    64. Step 3: Verify Detection Accuracy

      Test Detection

    65. From VPN in EU:
    66. – Connect to EU VPN
      – Clear cookies
      – Visit site
      – GDPR banner should show

    67. From California IP:
    68. – Connect to California VPN
      – Clear cookies
      – Visit site
      – CCPA banner should show

    69. Browser Dev Tools:
    70. – Open Console
      – Look for logs like: “Geo region: EU”
      – Verify template selection

      Check Console Logs

      Enable debug logging:

    71. Go to SLOSSettingsAdvanced
    72. Check “Debug Logging”
    73. Console will show:
    74. – Detected region
      – Matched rule
      – Selected template
      – Fallback steps

      Manually Test API

      In browser console:
      `javascript
      fetch(‘/wp-json/slos/v1/geo/region’)
      .then(r => r.json())
      .then(d => console.log(‘Region:’, d));
      `

      Returns: {"region": "EU"} or similar

      Step 4: Test All Templates

      Visual Verification

      Test each scenario:

    75. EU Detection:
    76. – GDPR-specific text
      – “More options” button
      – Cookie category explanations

    77. CCPA Detection:
    78. – “Do Not Sell” language
      – California-specific rights
      – CCPA terminology

    79. Default Detection:
    80. – Simple accept/reject
      – Basic information
      – Minimal text

      Verify Consent Recording

      After interacting with each template:

    81. Go to Consent ManagementConsents
    82. Look for recent entries
    83. Check georuleid field
    84. Verify rule ID matches expected rule
    85. Step 5: Handle Special Cases

      IP Geolocation Limitations

      Some IPs are hard to detect:

    86. VPN users
    87. Proxy users
    88. Corporate networks
    89. ISP non-standard routing
    90. Solution:

    91. Add fallback detection
    92. Allow manual region selection
    93. Use secondary detection methods
    94. Adding Manual Region Override

      Allow users to override detected region:

    95. Edit banner text to add:
    96. “Not from [Region]? [Change Region]”

    97. Link changes browser selection
    98. User selects correct region
    99. Browser stores preference
    100. Whitelist/Blacklist Countries

      Create country lists:

    101. Go to Geo RulesSettings
    102. Whitelist: Countries that MUST use specific template
    103. Blacklist: Countries excluded from rules
    104. High priority enforced
    105. Save settings
    106. Step 6: Monitor Geo Detection

      Dashboard Metrics

      In Consent ManagementDashboard:

    107. Regional distribution of consents
    108. Template impressions by region
    109. Acceptance rate by template
    110. Geo-detection accuracy
    111. Create Report

      Export geo data:

    112. Go to ReportsGeo Analysis
    113. Select date range
    114. View by region, country, template
    115. Download CSV report
    116. Share with compliance team
    117. Common Metrics

    118. Consents per region
    119. Template impressions by region
    120. Acceptance rates by template
    121. A/B variant distribution by region
    122. Time-to-decision by region
    123. Step 7: Troubleshooting Geo Rules

      Banner Still Shows Wrong Template

      Check:

    124. Verify rule is enabled
    125. Check rule priority
    126. Verify template exists
    127. Clear browser cookies
    128. Check console logs for errors
    129. Solution:

    130. Increase rule priority
    131. Disable conflicting rules
    132. Update template settings
    133. Geo Detection Not Working

      Check:

    134. Verify geolocation service enabled
    135. Test API endpoint manually
    136. Check server logs
    137. Verify user IP visible to server
    138. Solution:

    139. Enable debug logging
    140. Check WordPress logs
    141. Verify server permissions
    142. Test with different IPs
    143. Wrong Region Detected

      Likely Causes:

    144. User on VPN
    145. Proxy server
    146. ISP location mismatch
    147. Geolocation database outdated
    148. Solutions:

    149. Allow manual override
    150. Use multiple detection methods
    151. Update geolocation database
    152. Document as known issue
    153. Step 8: Compliance Verification

      GDPR Compliance

      For EU rule:

    154. ✓ Template has GDPR language
    155. ✓ Consent is explicit
    156. ✓ Rejection easy as acceptance
    157. ✓ Granular control available
    158. ✓ Consent recorded with geo data
    159. CCPA Compliance

      For California rule:

    160. ✓ Template shows CCPA language
    161. ✓ “Do Not Sell” clearly displayed
    162. ✓ Rights explained
    163. ✓ Opt-out possible
    164. ✓ Consent tracked
    165. LGPD Compliance

      For Brazil rule:

    166. ✓ Portuguese language preferred
    167. ✓ LGPD rights displayed
    168. ✓ Consent explicit
    169. ✓ Data storage explained
    170. ✓ International transfer notice
    171. Best Practices

    172. Test Thoroughly – Use VPNs to test all regions
    173. Keep Rules Simple – Don’t over-complicate
    174. Prioritize Correctly – Specific rules first
    175. Monitor Accuracy – Check for misdetections
    176. Document Rules – Keep notes on setup
    177. Review Regularly – Update rules quarterly
    178. Get Legal Review – Ensure compliance
    179. Have Fallback – Default rule for unknowns
    180. Advanced: Custom Geo Rules

      Create custom rules beyond pre-built:

    181. Go to Geo RulesAdvanced
    182. Custom Rule Name – Describe the rule
    183. Conditions:
    184. – Country codes
      – Region/state codes
      – IP ranges
      – Custom parameters

    185. Action: Select template
    186. Priority: Set priority
    187. Save Rule
    188. Example: Japan-specific rule
      `
      Condition: Country = JP
      Template: Detailed template (heavy tracking)
      Priority: High
      `

      Next Steps

    189. Enable geo-targeting
    190. Create rules for your regions
    191. Test with VPNs
    192. Monitor detection accuracy
    193. Adjust rules as needed
    194. Review compliance quarterly
    195. Related Articles

    196. Setup Cookie Banner
    197. A/B Testing Guide
    198. Analytics Integration

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket