1. Help Center
  2. HB Manager
  3. Applications & Use-cases

Google changeCorrelator false

googletagCalls & refresh

Overview

This article outlines a method by which a publisher can maintain the correlator value across GAM adserver calls post refresh.

GAM requests with the same correlator value are considered to be in the same page-view, as such this method is useful for those lazyloading ads either in long form content or infinite scroll.

To maintain the correlator we use the googletagCalls object available in the relevantDigital.loadPrebid() function which allows a publisher to intercept the default googletag.pubads().refresh() behavior and add the changeCorrelator: false option.

Code

relevantDigital.loadPrebid({ 
    googletagCalls: {
        refresh: (slots) => googletag.pubads().refresh(slots, { changeCorrelator: false }),
    },
});

Walk-through

Here we add the googletagCalls object directly to the loadPrebid function.

The googletag.pubads().refresh() function will recieve a slot object, which when using googletagCalls.refresh can be retrieved. 

The same slot object is then pushed back into an updated googletag.pubads().refresh() including the changeCorrelator option.