Hi,
After switching to Cloudflare Proxy we no longer get tracked sessions in insights.
Is there any settings that makes this possible again?
/Thomas
Developer forum
E-mail notifications
Insights session tracking and Cludflare proxy

Replies


Hi Thomas
Can you share a bit more information?
I cannot find a product called "Cloudflare Proxy" on Cloudflare website: https://www.cloudflare.com/application-services/products/
What have you setup? How did you set it up? What happens inside Dynamicweb - no tracking at all? Or missing IPs. What are you seeing or not seeing in the backend. Maybe share a screendump. Also share a dump of your tracking settings. And maybe even a link to the solution.
Thanks, Nicolai

I believe we're experiencing something similar - many of the standard DynamicWeb session metrics are empty following the implementation of Cloudflare:


Cloudflare have 50 products or more. Which Cloudflare product did you setup with what settings?
What does Cloudflare documentation say about sessions and cookies when you setup what you have setup in Cloudflare?
It sounds more like a question you should send to Cloudflare.


Asking ChatGPT I get these pointers:
This issue is likely caused by how Cloudflare handles requests and interacts with session and cookie-based tracking. Cloudflare acts as a proxy between the user and your server, and depending on its configuration, it might interfere with or block session cookies or JavaScript-based tracking.
Here are potential reasons and solutions:
1. Caching Configuration
- Problem: Cloudflare's aggressive caching might serve cached pages that bypass your backend session handling. If cookies or session identifiers are not respected, the website analytics will miss that data.
- Solution: Configure Cloudflare to bypass cache for pages or endpoints requiring session data or cookies. Use "Bypass Cache on Cookie" rules if using cookies for session tracking.
2. Bot Management or Security Features
- Problem: Cloudflare’s security features, like Bot Management, might block or challenge JavaScript tracking or cookies from being set or sent.
- Solution: Review the Bot Management and security settings. Whitelist the user agents of your analytics tools.
3. Privacy or Performance Features (e.g., Rocket Loader)
- Problem: If Rocket Loader or other performance optimizations are enabled, they might delay or block JavaScript responsible for cookie or session tracking.
- Solution: Temporarily disable Rocket Loader or add specific scripts to the Rocket Loader ignore list.
4. Cookie Settings
- Problem: Cloudflare’s proxy might strip or block certain cookies (e.g., SameSite, Secure flags) if your site doesn't use HTTPS or properly configured cookies.
- Solution: Ensure all cookies used for tracking have proper flags (Secure, SameSite=None for cross-site tracking). Also, confirm the site uses HTTPS.
5. IP Address Obfuscation
- Problem: If your analytics rely on session tracking based on IP addresses, Cloudflare’s proxy IPs might overwrite the original visitor IP.
- Solution: Use the Cloudflare
CF-Connecting-IP
header to restore the original visitor IP for session tracking.
6. Custom Firewall Rules
- Problem: Custom rules in Cloudflare’s firewall (e.g., blocking specific cookies or parameters) might interfere with analytics.
- Solution: Check your Cloudflare Firewall Rules and ensure nothing blocks or alters the necessary cookies, headers, or scripts.
Debugging Steps:
- Inspect HTTP Requests: Use developer tools to see if cookies or session data are being sent/received as expected.
- Check Cloudflare Logs: Review the Cloudflare dashboard for potential blocked requests or challenges.
- Run Analytics Tests: Use tools like Google Tag Assistant or similar to test analytics scripts.
If the issue persists, try disabling Cloudflare temporarily to confirm whether it’s the root cause. Then work with Cloudflare’s support or documentation to adjust the settings accordingly.




Hi Nuno
Did you make it work? If you did, we would love the information so it can be added to documentation.
Thanks!


Hi Nicolai,
Not sure what went wrong with my previous reply
Yes, we got it to work (based on Melissa's comment). We had to enable (the deprecated) Statistics (we only had Tracking enabled).
Best Regards,
Nuno Aguiar
You must be logged in to post in the forum