JavaScript Snippet
  • 05 Jul 2023
  • Dark
    Light

JavaScript Snippet

  • Dark
    Light

Article Summary

TO set custom parameters:

  1. Login to Console.
  2. Go to Platform Settings > Applications > Overview.
  3. Select the required application and go to Integration details.
    Integration_details_2
  4. In the Snippet window, click CopyCopy.
  5. Before embedding the snippet into your application, add this line of code for each custom parameter:
    window._pxParamN = "<paramN_value>".

Example
To extract the value of my_cookie, add a custom parameter in this format:

<script type="text/javascript">
	(function(){
		window._pxAppId =APP_ID;
		// Custom parameters
		window._pxParam1 = getCookie('my_cookie');
		var p = document.getElementsByTagName('script')[0],
		    s = document.createElement('script');
		s.async = 1;
		s.src = '//client.perimeterx.net/APP_ID/main.min.js';
		p.parentNode.insertBefore(s,p);
	}());
</script>

Was this article helpful?