Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are you familiar with enableSingleRequest()? #26

Open
jackson-sandland opened this issue Jul 30, 2019 · 3 comments
Open

Are you familiar with enableSingleRequest()? #26

jackson-sandland opened this issue Jul 30, 2019 · 3 comments
Labels

Comments

@jackson-sandland
Copy link

jackson-sandland commented Jul 30, 2019

I'm trying to implement enableSingleRequest().
I have it set up the way google suggests:

    this.googletag.cmd.push(() => {
      if (this.props.enableSingleRequest) {
        // Infinite scroll requires SRA
        this.googletag.pubads().enableSingleRequest();
      }

      // add support for async loading
      this.googletag.pubads().enableAsyncRendering();

      // collapse div without ad
      this.googletag.pubads().collapseEmptyDivs();

      // load ad with slot refresh
      this.googletag.pubads().disableInitialLoad();

      // enable google publisher tag
      this.googletag.enableServices();
    });

I have 6 ads on one of the pages, and I'm still seeing 6 requests.
I'm also seeing multiple slots have the exact same ad, which is the problem that SRA is used to resolve.
I have an adComponent that gets loaded in each slot.
Do I need to restructure how I'm using my googleAd react component so that it works in harmony with the other slots?
Any help is appreciated.

I found the high level solution in the google docs for enableSingeRequest() but no pattern for how to implement this in a react application:

Create one SRA request with all ad slots to best serve guaranteed
roadblocks or competitive exclusions, instead of sending 
SRA requests with one ad slot at a time.

Thanks :)

@jackson-sandland
Copy link
Author

Bueller?

@seeden
Copy link
Owner

seeden commented Jul 31, 2019

You can not use enableSingleRequest because it will not download new ads on the next page. This package is for SPA

@jackson-sandland
Copy link
Author

jackson-sandland commented Aug 1, 2019

I figured out how to enable singleRequestArchitecture using enableSingleRequest in a react app using redux and I've verified that only one request results in 6 ad slots being served where previously there were 6 requests.
One thing I'm not sure of is whether I should be seeing all unique ads.
3 of the ads are always the same ad - this is what SRA is meant to prevent. Google calls it a "guaranteed roadblock".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants