|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<meta http-equiv="Content-Language" content="en"> |
| 5 | +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | +<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | +<title>DAP Implementation Test</title> |
| 8 | + |
| 9 | +<!-- Digital Analytics Program (DAP) --> |
| 10 | +<script type="text/javascript"> |
| 11 | +(function() { |
| 12 | + var dapScript = document.createElement('script'); |
| 13 | + dapScript.id = '_fed_an_ua_tag'; |
| 14 | + dapScript.async = true; |
| 15 | + dapScript.type = 'text/javascript'; |
| 16 | + dapScript.src = 'https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=DOE&subagency=BES&sitetopic=science'; |
| 17 | + |
| 18 | + dapScript.onerror = function() { |
| 19 | + console.log('DAP analytics script failed to load - continuing without analytics'); |
| 20 | + document.getElementById('dap-status').innerHTML = '<span style="color: orange;">⚠ DAP failed to load (expected on isolated networks)</span>'; |
| 21 | + }; |
| 22 | + |
| 23 | + dapScript.onload = function() { |
| 24 | + console.log('DAP analytics script loaded successfully'); |
| 25 | + document.getElementById('dap-status').innerHTML = '<span style="color: green;">✓ DAP loaded successfully</span>'; |
| 26 | + }; |
| 27 | + |
| 28 | + document.head.appendChild(dapScript); |
| 29 | +})(); |
| 30 | +</script> |
| 31 | + |
| 32 | +<style> |
| 33 | +body { font-family: Arial, sans-serif; margin: 40px; } |
| 34 | +.test-section { margin: 20px 0; padding: 15px; border: 1px solid #ddd; border-radius: 5px; } |
| 35 | +.status { font-weight: bold; } |
| 36 | +</style> |
| 37 | +</head> |
| 38 | +<body> |
| 39 | + |
| 40 | +<h1>DAP Implementation Test Page</h1> |
| 41 | + |
| 42 | +<div class="test-section"> |
| 43 | + <h2>Digital Analytics Program (DAP) Status</h2> |
| 44 | + <p id="dap-status" class="status">⏳ Loading DAP script...</p> |
| 45 | + <p><small>This tests the same DAP implementation used in the WebMon base template.</small></p> |
| 46 | +</div> |
| 47 | + |
| 48 | +<div class="test-section"> |
| 49 | + <h2>Implementation Details</h2> |
| 50 | + <ul> |
| 51 | + <li><strong>Script ID:</strong> _fed_an_ua_tag</li> |
| 52 | + <li><strong>Agency:</strong> DOE (Department of Energy)</li> |
| 53 | + <li><strong>Subagency:</strong> BES (Basic Energy Sciences)</li> |
| 54 | + <li><strong>Site Topic:</strong> science</li> |
| 55 | + <li><strong>Loading Method:</strong> Dynamic injection with error handling</li> |
| 56 | + </ul> |
| 57 | +</div> |
| 58 | + |
| 59 | +<div class="test-section"> |
| 60 | + <h2>Browser Console Output</h2> |
| 61 | + <p>Open your browser's developer console (F12) to see DAP loading messages.</p> |
| 62 | + <p>Expected messages:</p> |
| 63 | + <ul> |
| 64 | + <li>✓ Success: "DAP analytics script loaded successfully"</li> |
| 65 | + <li>⚠ Network isolation: "DAP analytics script failed to load - continuing without analytics"</li> |
| 66 | + </ul> |
| 67 | +</div> |
| 68 | + |
| 69 | +<script> |
| 70 | +// Additional test to check if DAP script element was created |
| 71 | +setTimeout(function() { |
| 72 | + var dapScript = document.getElementById('_fed_an_ua_tag'); |
| 73 | + if (dapScript) { |
| 74 | + console.log('✓ DAP script element found in DOM'); |
| 75 | + console.log(' - Script src:', dapScript.src); |
| 76 | + console.log(' - Script async:', dapScript.async); |
| 77 | + } else { |
| 78 | + console.log('✗ DAP script element not found in DOM'); |
| 79 | + } |
| 80 | +}, 1000); |
| 81 | +</script> |
| 82 | + |
| 83 | +</body> |
| 84 | +</html> |
0 commit comments