How to Add Countdown Timer Button to a Blogger Website?

Rayan
By -
0
Hello friends, today I'll show you how to add a Countdown Timer button to your website's post. 

Why You Should Use Download Timer Button

The download timer button is a special type of button that helps keep users on your website for a longer time, which reduces your website's bounce rate. Additionally, if you place ads above and below the download button, your earnings may increase slightly. 

When someone comes to your website to download something, they quickly get what they need and leave your webpage for another site. This increases your website's bounce rate and decreases ad impressions, which in turn reduces your earnings. But don't worry! After learning my trick, you'll be able to keep users on your website for a longer time and lower the bounce rate. 

So, when a user visits your website and clicks this button, they will have to wait for 30 seconds (which you can change) before they can proceed to the link. This will help reduce your website's bounce rate, increase impressions, and slightly boost your website's income.

How to Add Timer Button in Blogger

First, you need to open your post in Blogger.
Then, choose the spot in your Blogger post where you want to add the timer button.
After selecting the spot for the timer button, copy any heading or other text that will appear below it.
Switch your Blogger post to HTML Mode, then use Ctrl+F to find the text or heading you copied earlier.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* CSS for the container */
.container {
display: flex;
flex-direction: column;
align-items: center; /* Center horizontally */
justify-content: center; /* Center vertically */
}

/* CSS for the button */
#my-button {
background-color: #007BFF;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}

/* Hover effect */
#my-button:hover {
background-color: #0056b3;
}

/* Glowing color-changing effect after click */
#my-button.clicked {
animation: glow 1s infinite alternate;
}

@keyframes glow {
0% {
background-color: #007BFF;
box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}
100% {
background-color: #ff7f00;
box-shadow: 0 0 20px rgba(255, 127, 0, 0.8);
}
}
</style>
</head>
<body>
<div class="container">
<div id="countdown-timer"></div>
<button id="my-button">Click Me!</button>
</div>

<script>
function startCountdown() {
var countdown = 30;

function updateCountdownDisplay() {
var timerElement = document.getElementById("countdown-timer");
if (countdown <= 0) {
window.location.href = 'https://www.example.com'; // Replace with your desired URL
timerElement.parentNode.removeChild(timerElement);
var buttonElement = document.getElementById("my-button");
buttonElement.parentNode.removeChild(buttonElement);
} else {
timerElement.textContent = "Time remaining: " + countdown + " seconds";
countdown--;
}
}

var countdownInterval = setInterval(updateCountdownDisplay, 1000);
updateCountdownDisplay();
}

var buttonElement = document.getElementById("my-button");
buttonElement.addEventListener("click", function () {
// Start the countdown
startCountdown();
// Add the "clicked" class for the glowing effect
buttonElement.classList.add("clicked");
// Disable the button to prevent multiple clicks
buttonElement.disabled = true;
});
</script>
</body>
</html>

Once you locate the start of that code, you need to insert the timer button code right before it.

Looks like we've successfully added the timer button! Now, after saving and publishing the post, you'll be able to see the timer button on your website. (Remember, the timer button won't show in preview mode.) 

In this post, we have learned how to add a Countdown Timer button to Blogger websites. This button helps keep users on your site longer, reducing your website's bounce rate and increasing ad impressions. You don't need to know much to add this button. By following the instructions above, you can easily add it into your site. 

I hope this post was helpful for you. If you have any questions, feel free to let me know in the comments!
Tags:

Post a Comment

0Comments

Post a Comment (0)