Support Topics Documentation Slack YouTube Blog

getting URL parameters in js file

(Tal Seren) #1


How can I get the URL parameters when calling a js file saved in web/scripts?


(Mark Piller) #2

Hi Tal,

Try this:


Where PARAMETERNAME is the actual parameter.


(Tal Seren) #3

this is not working:

var clk = request.query.clk;

var userAcquisitionRedirectsItem = new UserAcquisitionRedirectsItem( { adNetwork : 'archy', appId : 'appId', clickId : clk, country : 'IL', userAdvertisingId : '1234-afjad-test', userIp : '' });

after this code I see in the table all the values, except for clickId which is empty

(Mark Piller) #4

How do you send the parameter in the URL?

(Tal Seren) #5

(Mark Piller) #6

Is it a GET or POST request?

(Tal Seren) #7

I’m pasting this url in a browser

(Mark Piller) #8

Well, I just did a simple test and it is working as expected. Here’s a URL to try:

Here’s the source code of the script: = function ( request, response )
    response.send( "value of the test parameter is: " + request.query.test );

It seems like the problem would be somewhere in your code.


(Tal Seren) #9

thanks mark, found my error