Hey team, is it possible to create a rudderstack P...
# support
p
Hey team, is it possible to create a rudderstack Page Event source via the API rather than from the front end interface? Trying to come up with the best way to incorporate the page event into our SaaS product for our clients. I could do it all through one universal page event JavaScript pixel, but my concern is that I won't be able to shut the pixel off for clients that cancel, and we'll continue getting charged for their page view events. Any thoughts on the best way to go about this?
h
your best bet is proxying via something like nginx then you can control the pass through
if somebody gets hold of the url/writekey they could ddos away using up your credits
p
Yikes, good point. Interesting idea with the proxy. I'll have to look into that. Any extra details on what that means, or what something like that might look like, would be helpful.
h
personally I prefer to be in complete control of this and always proxy
better for 1st party cookies adblocks too
as for what it looks like - a proxy per client...then remove the proxy when they cancel
the request wont be forwarded to rudderstack
get nginx to respond with a 500 or 429 or similar...or just dump the route
you can hide the actual write keys in your proxy
so not exposing them to the outside world
p
Very helpful, thank you. Think I'll find instructions on how to do something like that if I Google nginx? We're pretty new to pixels, so still trying to figure out how we'd piece it together if the rudderstack pixel itself wasn't on the page.
h
depends if any of your team have skills in nginx - might be a learning curve - but good knowledge to learn - you could use haproxy etc too
p
We can probably figure it out based on your advise there. :) Do you have a mock example of what the pixel might look like (the JavaScript code) that our clients would put on their website, assuming it would need to pass along all the data the rudderstack page view pixel would otherwise be gathering?
h
I'll try and put something together later/tomorrow
p
That would be amazing man. Gigantic thanks in advance if you're willing to do that.
You guys think there might be a way to accomplish some of this with an AWS service? Maybe AWS Event Bridge or API Gateway? Still vague on how to best create a javascript pixel that fires to the right destination where we meter and route the events, then send the right data to the Rudderstack Page view event. One thing that's somewhat unclear is how we get the pixel to send all the data that rudderstack would normally be tracking without the rudderstack pixel itself being on the page.
h
@proud-jackal-92554 sorry had no time - why cant you use the rudder js and just fire it to an endpoint on your side - then route
p
All good @hundreds-lifeguard-65770. Thanks for the note. :) So, add the rudder js to a pixel container that points to a webhook in my ecosystem? Would that collect all the same page event data and send it via JSON, but without using a rudderstack event call? For example, say I wanted to send the page event data to AWS SQS to que for later processing, would that work? Our goal is to securely get the data into our Databricks environment.
h
No - I meant forget the pixel api and just use the normal js sdk but set the DATA_PLANE_URL to your own web server - you can then choose to forward it to rudderstack or not depending if that client is still live