Hi there, We have following setup: Frontend: Vue....
# support
h
Hi there, We have following setup: Frontend: Vue.js / Nuxt.js Application Backend: Ruby on Rails (REST API) We want to track pageviews both on client and also on server side to not loose pageviews by Adblockers. Our idea was following: Since we also track several other events on our Rails Backend (e.g. when a user makes a purchase, sends a contact form etc), we thought about also tracking pageviews then via our Rails Backend. We wanted to add a new REST API Endpoint, where we could pass all needed properties from the client (page, query params, anonymous_id, user_id, ...) and where we then can send the pageview to RudderStack. In parallel we also wanted to track the pageview on the frontend. For example (on every page visit):
Copy code
// send page event to segment on frontend
this.analytics.page('Home')

// send request to rails backend
this.$axios.$post('xxx', all_required_params_including_anonymous_id)
Here our questions: 1. Are there already any best practices or recommendations how server side pageview tracking could be done for our setup? 2. Does it make sense to track first the pageview on client side and afterwards/at the same time make a request to our rails backend to track the pageview? Thanks and best regards
Thanks 🙂
h
You can avoid adblock by using rudder first party
h
Thanks for your quick replies! 🙂
When we for example use facebook pixel destination then adding the custom domain will help us to bypass adblockers, right? (at least if we use the cloud mode?)
h
yeah as it is proxied via same domain so 1st party
h
Hi again, Sorry for my follow up question @hundreds-lifeguard-65770 : I found out that a lot different Adblockers (e.g. Adblock Plus) are blocking all URLs which contains
analytics.js
or
analytics.min.js
. Thus even adding a proxy or an own domain, it will be blocked. Is there any way to rename the script filename?
I also wonder if this adblock page tracking would be still working if the script tag is blocked by adblockers?https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/detecting-adblocked-pages/
h
rudder uses ra.js so wont be blocked or are you talking about other libs in device mode?
If you proxy the script file you can call it what you want
h
Yes I added a cloudfront function to rename it. Thanks
h
yeah the docs should say that - adblocks also block /track calls too - would be nice if the route was dynamic/random to avoid
p.s I dont work for rudder
🙌 1
h
ah ok 😄 thanks for your help, appriciate it 🙂
👍 1
Yes. A random name, which we could set would be great. Device Destinations will be blocked anyways. But we could at least use the analytics.js to use some cloud destinations…
h
yup else http post to them from a transformation