This guide provides an overview of Freestar's ad refresh functionality, designed to help you maximize ad impressions and revenue by dynamically updating ad content on your site without requiring full page reloads.
What is Ad Refresh?
Ad refresh is a feature that automatically loads new ads into existing ad placements on your web page after a certain period or specific user interactions. This means more ads can be shown to a user during a single page visit, increasing the number of impressions.
Controlling Ad Refresh Manually
While ads can refresh automatically, you also have granular control to trigger refreshes based on specific events or user actions on your site. This is particularly useful for single-page applications (SPAs), infinite scroll pages, or after interactions like completing a game or closing a modal.
All manual control methods should be pushed to the freestar.queue.
Refreshing Ad Slots: freestar.refresh(my_slot_id)
Use the freestar.refresh() method to trigger a new ad load in one or more existing ad slots.
Refresh a Single Ad Slot:
Provide the slotId of the ad unit you want to refresh.
JavaScript
freestar.queue.push(function() {
freestar.refresh("my_slot_id_1");
});Refresh Multiple Specific Ad Slots:
Provide an array of slotId strings.
JavaScript
freestar.queue.push(function() {
freestar.refresh(["my_slot_id_1", "my_slot_id_2"]);
});Refresh All Ad Slots on the Page:
Call the method without passing any arguments to refresh all ad slots on page.
JavaScript
freestar.queue.push(function() {
freestar.refresh();
});
By default, Freestar's ad units refresh every 30 seconds. Please consult with support before implementing theÂ
refresh method by submitting a request here.
Disabling Automatic Refresh Globally: freestar.disableRefresh()
If you need to temporarily stop all automatic ad refreshing across your page (e.g., during critical user flows or specific content sections), you can use this method.
JavaScript
freestar.queue.push(function() {
freestar.disableRefresh();
});
Enabling Automatic Refresh Globally: freestar.enableRefresh()
If you've previously disabled automatic refresh using freestar.disableRefresh(), you can re-enable it with this method.
JavaScript
freestar.queue.push(function() {
freestar.enableRefresh();
});This will restore the default or pre-configured automatic refresh behavior for your ad slots.
Â
Consult Your Freestar Contact: Ad refresh is a powerful tool. We highly recommend discussing your specific needs and implementation plans with your Freestar Point of Contact. They can help you optimize settings and ensure best practices are followed for your site.
We hope this guide helps you effectively utilize Freestar's ad refresh capabilities!
Â