Integration
  • 27 Apr 2023
  • Dark
    Light

Integration

  • Dark
    Light

Article Summary

Using Code Defender can be easily done in both cases of Sensor integration, Third Party or First Party.

To ensure optimal functionality of our Sensor, here are our Best Practice recommendations:

1. Snippet Code
First Party is the recommended integration.
example for PX_SENSOR_URL - //client.px-cloud.net/PX1234/main.min.js

<script src="PX_SENSOR_URL" async ></script> 

If custom parameters are needed:

<script type="text/javascript">
    (function(){
        // Custom parameters
        // window._pxParam1 = "<param1>";
    }());
</script>
<script src="PX_SENSOR_URL" async />

2. Snippet Location
The snippet should be placed within the <head> tag.
The visibility of the Sensor can be affected if the snippet is not placed in the <head> tag.

3. Snippet Order
Place the snippet at the top of the <head> tag.
If it is placed lower in the head, the coverage will be less effective.


Was this article helpful?

What's Next