How to pass a URL parameter to a tracking pixel


Hey there!
If my form confirmation page URL is

and a marketing-tracking pixel installed in the confirmation page is
script type=‘text/javascript’ src=“”"

Where the script parameter APPID needs to be populated with the URL parameter PHONE.

Is it possible? If so, how should I do it?


This is easily done with Google Tag Manager by creating variables that capture the value of Q or Z.

Then the variable can be used as a parameter for a custom dimension for instance.

If you don’t have access to Google Analytics, you could use the following setup:

// Grab parameters from URL
var searchParams = new URLSearchParams(;
var qpQ = searchParams.get("Q");
var qpZ = searchParams.get("Z");
// Basic Google Universal Tracking Code
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  ga('create', 'UA-44081296-1', 'auto');
// Modify the page view call to use the values of Q and Z as values for custom dimensions 1 and 2
  ga('send', 'pageview',{
	'dimension1': qpQ,
	'dimension2': qpZ

Don’t forget to define the necessary custom dimensions in your GA property first.

Thanks & Regards,
Techtiq Solutions