How to confirm whether the JS tracking script installed on the customer's website is effective?
P粉990568283
P粉990568283 2023-08-10 15:00:12
0
1
468
<p>We operate saas analytics applications similar to hotjar and google analytics. Customers need to install our javascript code on their website for us to track. </p> <p>How do we verify that this script was successfully installed and loaded on their site? (We know the domain name)</p> <p>The current method is to call an API from the script when it loads, and the second method is to crawl the page to verify that the script exists. </p> <p>If the script loads successfully, it will pass an API post request. However, if the script is used on any test site, it may produce spurious loading. I'm wondering what the industry standard is in this case, since this is used across all install script sites. </p>
P粉990568283
P粉990568283

reply all(1)
P粉099145710

Based on preliminary observations, I will take the following steps:

  1. Write a script that parses the page and checks if the script is added to the header.
  2. Check if the script to be loaded is in the footer and run when the page loads.
  3. To avoid false positives, use a unique identifier on the page, which is not used during development. For example, get the location.host variable from the script and pass it to the analysis tool for verification.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!