Skip to main content

Hello,

I'm not sure if this is something that I could do with zapier.

I have a web page that is visited by users from time to time, URLs have GET parameters, for example:

www.website.com/?user_id=123&visit_id=456

I need to log all visits to a spreadsheet:

user_id: 123

visit_id: 456

Thank you!



Hi @ocean_ and welcome to the Zapier community.

This is possible but will take a bit of magic/HTML coding on your part. Essentially you'd need to get the values from the URL within your HTML code and the call an "image" with no width or height which is a URL to a Zapier Webhook passing the values.

First thing to do is create a zap with a trigger of a webhook by Zapier "catch webhook" Then copy that URL for use later.

The edit your HTML if it's in php you can use $_SERVER['QUERY_STRING'] to get the parameters passed to that page. If it's not PHP replace that in the following img tag with whatever code will get the query string parameters for your website. Use the querystring parameters in the following way:

So it would end up looking like

Now each time someone loads the page the zap will trigger with the same URL Parameters.

You may want to put a filter in the zap for empty parameters and you will want to add a step to add a new row to your spreadsheet.

In short, any web request (for an HTML page or an image etc is a GET request, so you can pass the URL parameters via calling an image.