Dynamic GAM paths
Note
Publift needs to configure this on our end to enable this featureOverview
Dynamic GAM paths allow publishers to efficiently manage ad units by leveraging page metadata to construct ad slot paths programmatically. This approach reduces manual configuration and supports scalable ad deployment.
How It Works
Fuse’s Zone Customiser reads specific meta tags from the page and uses their values to build the GAM slot path. This enables flexible targeting and organization of ad units based on page context.
Benefits
- Scalability: Easily support thousands of ad units without manual setup.
- Flexibility: Ad slot paths adapt to page content and structure.
- Reduced Operational Overhead: Minimizes manual configuration for publishers and engineering teams.
This feature streamlines the process of managing large numbers of ad units by automating the creation of GAM paths. Instead of manually configuring each zone, publishers can simply add relevant metadata to their pages. Fuse then uses this metadata to generate the appropriate GAM slot paths, ensuring ads are targeted and organized according to the page’s context.
Publishers can add metadata to their site, which our engineering team will use to construct dynamic GAM paths programmatically.
Example using Metadata for dynamic GAM paths
For account that are going to publish meta data on each page as such:
<meta name="page-type" content="srp"/>
<meta name="category-l1" content="pets"/>
<meta name="category-l2" content="dogs-puppies"/>
And we need to build the JS to construct the GAM slot path as such:
<GAM_network_ID>/<Parent_ad_unit>/<page-type>/<category-l1>/<category-l2>
where,
GAM_network_ID = 123456
Parent_ad_unit = abcwebsite.web
page-type = third tier of the ad unit path
category-l1 = fourth tier of the ad unit path
category-l2 = fifth tier of the ad unit path.
The JS will look like this -
const metaPageType = document.querySelector('meta[name="page-type"]');
const metaCategoryL1 = document.querySelector('meta[name="category-l1"]');
const metaCategoryL2 = document.querySelector('meta[name="category-l2"]');
if (metaPageType && metaCategoryL1 && metaCategoryL2 && zoneId == '21689884288') {
const catPageType = metaPageType.getAttribute('content');
const catL1 = metaCategoryL1.getAttribute('content');
const catL2 = metaCategoryL2.getAttribute('content');
return {
gamSlotPath: `/123456/abcwebsite.web/${catPageType}/${catL1}/${catL2}`,
id: `custom-${catPageType}-${catL1}-${catL2}`,
};
}
return undefined;