Edit in JSFiddle

function logAction() {
    clickCount++;
    var logger = document.getElementById('logger');
    logger.src = 'https://example.com?clickCount=' + clickCount;
    var statusDiv = document.getElementById('status');
    statusDiv.innerHTML = history.length;

}
var clickCount = 0;
var actionButton = document.getElementById('action-button');
actionButton.addEventListener('click', logAction, false);
<iframe id="logger" src="https://example.com"></iframe>
<br />
<button id="action-button">Action!</button>

<div>History length:</div>
<div id="status"></div>