The Pop JS code allows you to easily implement a popunder on your website, presenting an unobtrusive advertisement method that pops up under the user's current window. Understanding and configuring the parameters appropriately ensures that you maximize the user experience while also optimizing your revenue.
filename:
tracker:
prelanding:
0
(standard value) to skip the prelanding. Use 1
if you wish to show a prelanding before the main content.expire:
0
means the ad will show every time.
To integrate the popunder on your site:
<head>
tags of your website pages where the popunder should be displayed:<script>
var filename = "Your_File_Is_Ready_To_Download";
//var filename = document['title']; //Uncomment in order to set title of the page as title of the smartlink
var tracker = "0";
var prelanding = 0; //0 - no prelanding, 1 - set prelanding
var popunder = {expire: 12, url: "https://exampledomain.com/d/WJJRLOK?title="+filename+"&tracker="+tracker+"&t="+prelanding};
</script>
<script src="https://static.exampledomain.com/64ec7d7c74a00.js"></script>
For more advanced users, there are methods to dynamically retrieve the file name either from the page's title or an <h1>
tag:
This simple method fetches the entire content of the <title>
tag to use as the file name.
var filename = document.title;
If there are certain words you wish to exclude from the title, this method will help you filter them out.
const removeWords = ["Latest", "Version", "Download", "Free", "Here"];
var filename = document.title.split(" ").filter(word => !removeWords.includes(word)).join(" ");
<h1>
Tag Without Filtering:This retrieves the content from the first <h1>
tag on the page.
var filename = document.querySelector("h1") ? document.querySelector("h1").innerText : "defaultFilename";
<h1>
Tag With Filtering:Similar to the title, you can filter out specific words or phrases from the <h1>
tag content.
const removeWords = ["Latest", "Version", "Download", "Free", "Here"];
var h1Content = document.querySelector("h1") ? document.querySelector("h1").innerText : "defaultFilename";
var filename = h1Content.split(" ").filter(word => !removeWords.includes(word)).join(" ");
Examples for each of these methods will be provided, aiding in your decision on the best method for your specific needs.