• Resolved SRD75

    (@srd75)


    Hi Folks,

    When connected to an Australian VPN, visiting our website will present our popup.

    If I select “Visit USA” I want to stay on the main website.

    If I wanted to go to mandoemedia.com/en-au/ I would select “Visit AU”.

    However, even though I am selecting “Visit USA”, and even though this keeps me on the same page, any further visits I am redirected to the /en-au/ version of the page.

    We are using GeoTargetingWP redirects to redirect anyone with the cookie to the ‘en-au’ version.

    Should we change this?

    Is there a cookie created when clicking on “Visit AU”? This would be the cookie we want to use to check and redirect to “en-au” on future visits.

    Here is our popup with ID=33720:

    <img src="https://mandoemedia.com/wp-content/uploads/2022/06/change-countries.svg" alt="change countries?" />
    <h3>Are you visiting Mandoe from outside your region?</h3>
    Visit your regional site for more relevant pricing, promotions and events.
    <p id="geo-buttons"><a id="geo-target" class="geo-button" style="color: black;"></a>Visit AUS <a id="geo-close" class="geo-button"></a>Visit USA</p>
    <script>
    function redirectAU(){
        var loc = window.location;
        var pathname = loc.pathname;
        var AustralianSite = 'https://mandoemedia.com/en-au';
        var finalURL = AustralianSite + pathname;
        window.location.href = finalURL;
    }
    jQuery( document ).ready(function() {
        jQuery("#geo-close").click(function() {
             jQuery(".spu-container").hide();
             wppopups.hidePopup(33720, true); 
        });
    });
    </script>
    
    <style>
      #spu-33720 {<br />
          text-align: center;<br />
          background-color: white !important;<br />
          border-radius: 26px;<br />
          border-radius: 15px?15px?15px?15px;<br />
          font-family: "Poppins", sans-serif;<br />
          ?-webkit-box-shadow: 3px 3px 10px 0 rgb(206 206 206 / 51%);<br />
          box-shadow: 3px 3px 10px 0 rgb(206 206 206 / 51%);<br />
          font-family: "Poppins", sans-serif;<br />
      }<br />
      #spu-33720 h3 {<br />
          font-size: 20px;<br />
          margin-top: 44px;<br />
          margin-bottom: 18px;<br />
      }<br />
      #spu-33720 p {font-size: 16px;}<br />
      #geo-buttons {<br />
          text-align: unset;<br />
          display: flex;<br />
          justify-content: space-between;<br />
          flex-direction: row;<br />
          width: 440px;<br />
          max-width: 100%;<br />
          margin: 66px auto 0 auto;<br />
      }<br />
      #geo-target {<br />
          background-color: #23ADF8;<br />
          color: white !important;<br />
      }<br />
      .geo-button {<br />
          border-radius: 24px;<br />
          font-size: 15px;<br />
          width: 176px;<br />
          height: 47px;<br />
          padding-top: 12px;<br />
          display: inline-block;<br />
          text-decoration: none;<br />
          cursor: pointer;<br />
      }<br />
      #geo-target.geo-button:nth-of-type(1):hover {<br />
          background-color: #5EC3FC;<br />
      }<br />
      .geo-button:nth-of-type(2) {<br />
          border: 2px solid #EDEDED;<br />
      }<br />
      .geo-button:nth-of-type(2):hover {<br />
          background-color: #23ADF8;<br />
          color: white;<br />
          border-color: #23ADF8;<br />
      }<br />
      .geo-button:hover {text-decoration: none;}<br />
      #spu-33720 .spu-close.spu-close-popup.spu-close-top_right {<br />
          color: #666;<br />
          text-shadow: none;<br />
      }<br />
      @media (max-width: 768px) {<br />
        #spu-33720 .spu-container {<br />
          padding: 50px 10px;<br />
        }<br />
        #geo-buttons {<br />
          flex-direction: column;<br />
          align-items: center;<br />
          margin-top: 66px;<br />
        }<br />
        #geo-target {<br />
          margin-bottom: 10px;<br />
        }<br />
      }<br />
    </style>

    Here is our geo redirect: https://i.imgur.com/GlaXj15.png

    Help appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Damian

    (@timersys)

    If you have multiple cookies set either you add them to the redirect rules to exclude them or your clear them when setting others. Eg:

    jQuery("#geo-close").click(function() {
             jQuery(".spu-container").hide();
             wppopups.hidePopup(33720, true); 
    // clear other cookie named spu_closing_18739
    wppopups.createCookie('spu_closing_18739',true, -1);
        });
    Thread Starter SRD75

    (@srd75)

    There’s not necessarily multiple cookies set.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom button & close button creating the same cookie’ is closed to new replies.