Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- have this in the head tag:
- <script>
- var url = "www.google-analytics.com";
- var method = "POST /collect HTTP/1.1";
- var postData = "v=1&t=event&tid=UA-XXX&cid=XXX&ec=gameTest&ea=newTest&el=testCampaign&ev=1";
- var async = true;
- var request = new XMLHttpRequest();
- request.onload = function () {
- var status = request.status; // HTTP response status, e.g., 200 for "200 OK"
- var data = request.responseText; // Returned data, e.g., an HTML document.
- }
- </script>
- and this in a test button:
- <button id="button" href="#newGame" onclick="request.open(method, url, async);request.send(postData);">Please click2</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement