title: i want data.js file to read data.js?key=123 as key = 123 inside its own code. so that the data.js file will work according to the key provided
body: <p>I need help regarding getting value from javascript</p>
  
  
  
  <p>i want to get key = 123 in data.js file so that i can send this value to another url.</p>
  
  <p>same as google analytics get user id from url like </p>
  
  <pre><code>&lt;script async src="https://www.googletagmanager.com/gtag/js?id=UA-000000000-1"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>user id  = UA-000000000-1</p>
  
  <p>i want data.js file to read key = 123 inside its own code. so that the data.js file will work according to the key provided</p>
  
  <p>i want to use it as this, so that i can embed this code anywhere and it will start working, its same as other tracking sites provides code with userid</p>
  
  <pre><code>&lt;script type="javascript" src="http://www.example.com/data.js?key=123"&gt;&lt;/script&gt;
  </code></pre>