search

Home  >  Q&A  >  body text

How to confirm whether the JS tracking script installed on the customer's website is effective?

<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粉990568283P粉990568283501 days ago552

reply all(1)I'll reply

  • P粉099145710

    P粉0991457102023-08-11 00:07:23

    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.

    reply
    0
  • Cancelreply