0:00
Hello everyone, welcome to Key2 blogging and in this video, I will show you how you can
0:03
install the anti-adblock script on your blogger website. So whenever someone uses adblocker on their browser, it will show a warning like this
0:12
to disable the adblocker. So if the user disable the adblocker and refresh this page, it will reveal the actual content
0:22
So in this way, you can force the user to disable the adblocker on your website
0:28
So when someone uses adblocker on their browser, the ad will not load in that page
0:34
So you will eventually lose the ad impression and ad click from your website
0:40
So you can counter this by using the anti-adblock script on your blogger website
0:45
So let's check how you can implement this on your blogger website. So for this, you have to go to the blogger dashboard and click on theme section
0:53
Now here click on edit HTML. Now you have to scroll down to the bottom and search for closing body tag
1:04
And then you have to go to this website and you have to copy the JavaScript code
1:09
So just copy the whole code from here. And paste it just above the body tag
1:17
So as you can see, I have already added the JavaScript code
1:20
So this is a flitro pro theme. So we don't need to add the CSS code
1:26
But if you are using any other theme, so let me just switch any other theme
1:32
And let me just view this blog. So this is an another theme and let me just click on blog post
1:40
And as you can see, the adblocker is activated in this page. So let's check how you can implement this anti-adblock script in this website
1:48
So for this, I will click on edit HTML. And I will scroll down to the bottom
1:55
And I will paste that JavaScript code above the closing body tag
2:00
Now I will go to this website and copy the CSS code
2:04
So just copy the CSS code. And let me just paste it above it
2:13
Now let me just click on save changes. Now let's go to the website and let me just refresh this page
2:24
So the code will not work in this case because the id of the blog post is different
2:29
So for this, I will click on inspect element. And I will select the whole post body
2:36
So I will click on here. And as you can see, this is the div class of whole post body
2:42
And I have to copy this id. So just copy this id
2:50
And I will go to the edit template and I will scroll down to the bottom
2:55
And I will replace the id here. So just search for get element by id
3:01
So I will replace the id here. So if you are using any other thing, then you have to inspect the id of your blog post
3:09
and replace the id here. Now let me just click on save
3:13
Let me just click on refresh. And as you can see, now the ad blocker script is working
3:27
So you have to install the post id in that script. Otherwise, the code will not work
3:34
So in that case, you can easily identify the id by just clicking on the inspect element
3:41
And then you have to click on this whole div class, where it will contain the whole blog post
3:48
So just copy the id. So here in this case, this is post body
3:53
And if we change this theme, let me just refresh this page
4:00
And let me just click on inspect element. And here the id is post dash body
4:08
So you have to change the id in the code. So let me just go to the edit template
4:15
And here it is, you have to change the id here. After that, it will work
4:19
And if you are using Flutter Pro or Mediany by theme, then you don't need to add the CSS code
4:25
So it will already be present in this theme. But if you are using any other theme, then you can add the CSS code for styling
4:33
And if I remove the CSS code, it will look like this
4:38
So let me just scroll down and let me just remove these tiles
4:44
And let me just save this. Now let me just refresh this page
4:54
Let me just block the page again. And let's refresh this. And as you can see, there is no styling edit
5:03
So if you are using any other theme, then you have to add this style tag
5:08
to properly apply the styling of this error page. I hope you got the idea how to install the anti-adblock script on your blogger website
5:20
And if you have any doubt regarding this, then you can ask me in the comment section
5:24
And if you like this content, then make sure to hit the like button
5:28
and subscribe to my channel for more upcoming videos like this. I will see you in the next video