Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter wesitegeezer

    (@wesitegeezer)

    Hi can I bump this?

    Thread Starter wesitegeezer

    (@wesitegeezer)

    I use tag assistant chrome to see the cookies load before/after cookie consent.tag assistant google chrome

    So this needs to load upon consent

    <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        googletag.defineSlot('/2197111111/SMR-LB-TOP', [[728, 90], [970, 90], [320, 50]], 'div-gpt-ad-158764111111-0').addService(googletag.pubads());
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>

    and this snippet to insert a banner is in the header.php

    <div id='div-gpt-ad-1587580236580-0'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1587580236580-0'); });
      </script>
    </div>

    ads not live yet so no ad loads. As need to sort the cookie first. ??

    • This reply was modified 4 years, 7 months ago by wesitegeezer.
    Thread Starter wesitegeezer

    (@wesitegeezer)

    Ok I think It’s correct now sorry…

    If you search source </head>

    Ive placed it in my head.php just before the closing </head>

    • This reply was modified 4 years, 7 months ago by wesitegeezer.
    Thread Starter wesitegeezer

    (@wesitegeezer)

    Hi Nicola, thanks for taking the time to reply to me, much appreciated. I will really appreciate the example as once I can see how it is done I will be able to repeat in future myself.
    =======================
    This as the actual code from the site https://admanager.google.com/ to serve ads on my site. I have the form already on the site, so just need this consent bundled in with that.

    code in the head

    <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        googletag.defineSlot('/2197111111/SMR-LB-TOP', [[728, 90], [970, 90], [320, 50]], 'div-gpt-ad-158764111111-0').addService(googletag.pubads());
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>

    code in the body that shwos the add block on the page

    
    <!-- /21976090514/SMR-LB-TOP -->
    <div id='div-gpt-ad-158764111111-0'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-158764111111-0'); });
      </script>
    </div>
    Thread Starter wesitegeezer

    (@wesitegeezer)

    Sorry this is what I need to do .. any help appreciated

    https://developers.google.com/doubleclick-gpt/samples/configure-cookies

    <!doctype html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>Configure Cookie Options</title>
        <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
        <script>
          window.googletag = window.googletag || {cmd: []};
          var cookiesEnabled = 1;
    
          googletag.cmd.push(function() {
            // Cookies are enabled by default. Set cookie options to 1 to disable.
            //
            // To ensure this option takes effect for all ad requests, place this
            // call before any calls to enableServices or display.
            googletag.pubads().setCookieOptions(cookiesEnabled);
    
            googletag.defineSlot('/6355419/Travel/Europe/France',[728, 90], 'banner-ad')
                .addService(googletag.pubads());
            googletag.enableServices();
          });
    
          function toggleCookieOptions(button) {
            // Cookie options can be changed at any time. Changes apply to all
            // subsequent ad requests.
            //
            // Set to 0 to enable cookies, 1 to disable.
            cookiesEnabled = cookiesEnabled === 0 ? 1 : 0;
    
            googletag.cmd.push(function() {
              googletag.pubads().setCookieOptions(cookiesEnabled);
    
              // Refresh all ads on the page for changes to take affect.
              googletag.pubads().refresh();
    
              button.setAttribute('data-enabled', cookiesEnabled);
            });
          }
        </script>
        <style>
          button::after {
            content: "DISABLED";
            color: red;
            font-weight: bold;
          }
          button[data-enabled="0"]::after {
            content: "ENABLED";
            color: green;
            font-weight: bold;
          }
        </style>
      </head>
      <body>
        <div id="banner-ad" style="width: 728px; height: 90px;">
          <script>
            googletag.cmd.push(function() {
              googletag.display('banner-ad');
            });
          </script>
        </div>
        <div>
          <button onclick="toggleCookieOptions(this);">
            Cookies
          </button>
        </div>
      </body>
    </html>
    Thread Starter wesitegeezer

    (@wesitegeezer)

    Hi Bhavik, thanks for reply

    have reached out to theme developer, will see what they get back to me with first. Am awaiting their reply first.

    regards Lee

    Thread Starter wesitegeezer

    (@wesitegeezer)

    Hi Thanks for quick reply, could not get that to work… but got this working in the end. Needed a GDPR anon lable printed to attach to order in letters not numeric. below works if anyone else needs

    
    add_action( 'wpo_wcpdf_before_order_data', 'wpo_wcpdf_customer_number', 10, 2 );
    function wpo_wcpdf_customer_number ($template_type, $order) {
    $numarr=array('A' => 0,
    'B' => 1,
    'C' => 2,
    'D' => 3,
    'E' => 4,
    'F' => 5,
    'G' => 6,
    'H' => 7,
    'I' => 8,
    'J' => 9);
    $narr = array_flip($numarr);
    $order_id = $order->get_id();
    $arr = str_split($order_id);
     
    $str = '';
    foreach($arr as $s)
       $str .= $narr[$s];
        ?>
    <div>
       <h2>Customer REF:</h2>
       <h1><?php echo $str . "\n"; ?></h1>
       </div>
        <?php
    }
    • This reply was modified 6 years, 6 months ago by wesitegeezer.
    • This reply was modified 6 years, 6 months ago by wesitegeezer.

    opps no delete post ??

    & # 038;

    (without the spaces)
    in the Amazon links when using the Amazon Link redirect… is that going to cause me a problem.? Thanks running the plugin in 300,000 pages no problem ?? Load speed all good, with wordfence cache.

    Cheers Paul, no problem, im just creating / frankenstines monster website anyway, and trying to see if google will index 300,000 pages of S**t. (with affiliate products:)

    Sorry another question is it possible to

    • Set title length to n characters (end on full word so assets dosent end up as ass ??
    • Stop zero price products showing in feed

    hi paul thanks for the great plugin I have implemented this as above with the code in functions and it appears to be correct.. I also noted that when i Utilize the Amazon Link Extra – Redirect, it changs some of th characters in the final ULR in the broser bar… It still gets to where its supposed to go, but im not sure if its formatted corrctly.
    can i PM you?

    Also stars not showing next to rating?

Viewing 12 replies - 1 through 12 (of 12 total)