Setting cookies not working after upgrading to Pro?

[ad_1]

It seems that setting a cookie is not working anymore after I’ve installed the Pro Freelance plugin? Before that I was setting a cookie named either fromNative or fromSocial depending on the url_source parameter in the URL of the visit. Depending on the set cookie I would show an ad unit (or I won’t). This worked like a charm, implemented as instructed on your support page, but I can’t figure out why it is not setting cookies anymore.
– Checked Chrome console, cookie fromSocial nor fromNative is present
– Not setting the cookies in Firefox or incognito Chrome either
– Ad units are not showing, although configuration has not changed an worked very well before
– Deactivated several possible header, footer and CSS codeblocks to debug.
– Tried pausing / unpausing blocks and resaving blocks after the installation of Pro
– Build in debugger of Ad Inserter says ‘no Javascript errors found’.

Below the code I”m using:

<script>
// Check if the cookie named "fromSocial" exists in the visitor's browser
if (document.cookie.indexOf("fromSocial") >= 0) {
  // If the cookie named "fromSocial" exists, delete it when the cookie with the name "fromNative" is created
  document.cookie = "fromSocial=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
  var hours = 4;
  var date = new Date();
  date.setTime(date.getTime() + (hours * 60 * 60 * 1000));
  document.cookie="fromNative=1; expires=" + date.toUTCString () + "; path=/";
} else {
  // If the cookie named "fromSocial" does not exist, create the cookie with the name "fromNative"
  var hours = 4;
  var date = new Date();
  date.setTime(date.getTime() + (hours * 60 * 60 * 1000));
  document.cookie="fromNative=1; expires=" + date.toUTCString () + "; path=/";
}
</script>

It checks if fromSocial exists, if so it ‘deletes’ it and sets the fromNative cookie. The settings are as follows:
– Active on all pages
– Lists > utm parameter whitelist: utm_source=native, utm_source=tab, utm_source=ob
– At the ad unit block it is configured through Lists > Cookies whitelist: fromNative

Unfortunately I can’t show the website just yet as it’s being developed on localhost. It will be migrated soon. Hopefully you can share your thoughts on this?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer