Latest posts

Browse topics

How To Setup Web Push Notifications For Drupal 8 (Or Any Other Site) Using OneSignal

Web push notifications are hot in 2017, we will see them more in future for sure. I've been using web push notifications for my personal blog and from what I've seen - it's very powerful marketing tool, allowing you to reach your audience very fast - for blogs and websites that means more returning visitors, for commerce sites that definitely means more sales.

In the past I've tried a few web push notifications providers, but at the end I've chose to stay with onesignal.com, because of it's absolutely free, no matter how many subscribers you have. Right now this blog has more than 7,000 active web push subscribers, growing at the rate of about 2,000 users per month. As my blog covers many topics, I've a pretty high unsubscribe rate too. This is the thing I'm missing in onesignal - more segmentation, as right now web push notifications are enabled on every page on this site, and at the end I have little control figuring out how to segment them.

Anyhow, recently I re-launched an older website covering tourism activities in Georgia, with promotions and deals - and then I realized - this is the right place were to use web push notifications. As this website is built by Drupal 8, in following tutorial I will provide details on how to setup web-push notifications for Drupal 8 website, but with a few minor tweaks this method should work for any other platform (WordPress, Joomla e.t.c.)

Now, if you don't have already onesginal account go and sign up for one (it's free).

Once you are registered for account, login and click on the a new add app screen to get started:

Add a new app screen ononesignal

Add a new app screen onesignal

Next, give it a name (your website's name, for example), and click on the create button

You will be asked to select a platform to configure:

Selecting platform to configure on onesignal

Selecting platform to configure on onesignal

Choose Website Push and click Next

On the next screen you will be asked to select either Google Chrome & Mozilla Firefox or Apple Safari, for the start let's choose Google Chrome and Mozilla Firefox, you will have a chance to add Apple Safari later. Click Next.

Now, let's assume that you have already https:// site enabled (if not, see how easy you could setup a free SSL from Let's Encrypt), or if you don't have yet https:// site you could choose option - My Site is not fully HTTPS

Web push notification setting screen

Web push notification setting screen

Enter your site URL and provide a link to default notification icon URL (I like to keep all of my onesignal notification icons in a separate folder on the root, and I've created a folder named onesignal, you may use different approach.

Click Save

On the next screen you will be asked to select target SKD, if you are using Wordpress you could go with WordPress selection, for Drupal or any other site we are going to choose Website Push

Select target SDK on onesignal

Select target SDK on onesignal

Click Next

You are almost done here, now it's the part to install actual code on your site, for Drupal 8:

Visit Web Push SDK Setup (HTTPS) for download files

Download and unzip the SDK files.

You should have:

manifest.json
OneSignalSDKWorker.js
OneSignalSDKUpdaterWorker.js

Upload these files to the root folder of your website

Edit manifest.json:

Change name and short_name to your site's name
Do not change the gcm_sender_id key (482941778795). This is a shared key used for push notifications (previously it required your own key, but this is no longer needed!)

{
  "name": "tourgeorgia.eu",
  "short_name": "tourgeorgia.eu",
  "start_url": "/",
  "display": "standalone",
  "gcm_sender_id": "482941778795"
}

change tourgeorgia.eu to your own website

Include and initialize the SDK

Open your html.html.twig template (if you don't have such, create it, as I didn't had html.html.twig but my template is based on bootstrap I just copied html.html.twig file from bootstartp template folder to my custom theme folder) and add following

 Include manifest.json in your themes <head> section


<!DOCTYPE html>
<html {{ html_attributes }}>
  <head>
    <head-placeholder token="{{ placeholder_token|raw }}">
    <title>{{ head_title|safe_join(' | ') }}</title>
    <css-placeholder token="{{ placeholder_token|raw }}">
    <js-placeholder token="{{ placeholder_token|raw }}">
<link rel="manifest" href="/manifest.json">
  <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async></script>
  <script>
    var OneSignal = window.OneSignal || [];
    OneSignal.push(["init", {
      appId: "YOUR_APP_ID",
      autoRegister: false,
      notifyButton: {
        enable: true /* Set to false to hide */
      }
    }]);
  </script>
  </head>

Now, you should go back to the onesignal homepage choose your app and browse for appId, you will find it under app settings, Keys & IDs, copy and paste to head section.

If you would like to show webpush subscribe button to every user accessing your website, and kind of aggressively, asking to subscribe to push notifications, you should change autoRegister value from false to true.

HTTPS Web Push notifications enabled on Drupal 8 site

HTTPS Web Push notifications enabled on Drupal 8 site

You can try a live example here: tourgeorgia.eu

In some of the future posts I will write a brief tutorial how to actually send your first push notification using onesignal.

Mintos.com Review after 3 month investing in Peer to Peer loans

April 21st marked 3 month anniversary since  I've been actively investing on Mintos.com marketplace. In today's article I will share some of my key findings on how much some can earn here with little money. 

Update: See my latest Mintos review: Mintos.com Review 2020 (36 Month of Investing in Peer to Peer Lending)

In short - my earnings here are very humble, with last April setting personal interest payment record at EUR 25.83. Depending on your investment strategy - that's from little to a lot. For me, this seems a decent start, and I'm looking to double monthly interest payments here by the end of the year. In general, if things (interest rates) continue to be as they are, it would ask to double my investments here.

Both individuals and entities can invest through Mintos. Individual investors must be at least 18 years old, have a bank account in the European Union or third countries currently considered to have AML/CFT systems equivalent to the EU, and have their identity successfully verified by Mintos. At the moment, US citizens or taxpayers cannot register as investors at Mintos.

Affiliate link here: Signup to Mintos.com here. By using this affiliate link for registration both you and I will receive — 1% of our average daily balance which should be paid in 3 installments for the first 90 days.

In total, during the past 3 months, from invested EUR 2,361.32 I've received in interest EUR 34.12 (after deducted currency exchange fees), statically speaking that would mean 1.44% year to date yield. 

I'm still building my million dollars saving account, and for 2017 I've decided to put aside $8,561, by now I've invested about 42% from that, and about $2,500 I've invested on Mintos (in several batches). Just recently I've started to build up my dividend stock portfolio, and I've invested some money in Baltic higher dividends paying stocks. Also some little money I've put in mutual funds, again in Baltics and Eastern Europe.

Investment portfolio April 2017

Investment portfolio April 2017

Mintos makes 69.2% from my total investment portfolio, followed by stocks in Nasdaq Baltics (25%) and mutual funds (5.8%)

As you can see by now Mintos makes the biggest part from my investment strategy, though for following months this year, I'm looking to increase investments in stocks and mutual funds. I would be happy ending this year with peer to peer lending contributing to my portfolio not more than 60%. In fact, as I believe, investments in peer to peer lending shouldn't be more than 20% from total portfolio. .As I'm just starting out right now, I feel I can afford greater risk (and hopefully greater interest)

My investment strategy on Mintos.com

I continue to invest in loans only with a buy back guarantee, which means, in case if loans go past due, loan originator would buy back bad loans, helping investors to avoid losing money. I tend to invest in shorter term (up to 3 month ) loans in Georgia, but have invested in long term (72 month) loans in Baltics and Poland also.

In April I had following currency portfolio: 849.79 EUR and 4,262.84 GEL, which is a great increase if compared my investment after first month here, as said I've deposited more money in several batches on Mintos. As I'm depositing money from Georgia based bank account in Georgian lari, I need to exchange money directly on platform, paying commission fee. I try to limit my currency exchange fees on platform to 10% from interest received.  In currency exchange fees I've paid GEL 19.55 , which equals to about EUR 7.34

Investments in Georgian lari

Investments in Georgian lari gives 17% interest rate with buy back guarantee, by now most of the earnings come from Georgian lari. In total I've got 77.86 lari in interest, what equals to about EUR 29.23

Investments in GEL (as on April 30, 2017)

Investments in GEL (as on April 30, 2017)

Net annual return have increased to 15.06% as most of the loans in Georgian lari are set at 17% annually, which is a decent, due to the Georgian lari volatility against EUR and USD currencies, greater interest comes with a greater volatility, and thus it might be tempting to invest in Georgian lari only, I try to exchange Lari to EUR (allocating 10% from total interest received). Also, as I don't think such high interest rates will continue for long, I've started to invest in longer than 30 day short term loans, investing in up to 2 year loans in GEL trying to keep higher interest rate longer.

Investments in EUR

During the past 3 month I've received in interest EUR 12.68, which doesn't seems a lot right now, but on the other hand, total investment in EUR currency is relatively small.

Investments in EUR (as on April 30, 2017)

Investments in EUR (as on April 30, 2017)

I plan to increase my investments in EUR currency slowly, it would be good to see about EUR 1,200 invested after another 3 month here. Which might generate about EUR 10 monthly, with interest rates as they are now. 

Again, I'm investing in buyback loans only, to push my interest rates higher I invest heavily in long term loans, including more than 72 month. 

Postfix Send Only SMPT Mail for Drupal 8 on Ubuntu 16.04, Nginx

If you have recently installed a fresh Drupal 8 site on Ubuntu 16.04 with Nginx running on it and you are getting Unable to send e-mail. Contact the site administrator if the problem persists notice after submitting contact form, you are missing an important element for your site to functions properly.

You could be missing important information about available updates, as Drupal uses cron to sends notification e-mails once updates are available. The following written applies not only to Drupal sites, it basically applies for Nginx and Ubuntu 16.04. Since I was working with a Drupal 8 project when faced unable to send e-mail, I'm mentioning Drupal. 

Inspired by: Email not working with fresh Drupal install on Ubuntu 14.04

Anyhow, here is a simple fix, how to quickly enable mail send for your server.

Install Postfix in 3 simple steps

You will need to have access to your VPS, login with user with sudo priviligies​

sudo apt-get install postfix

Follow on screen instructions, leaving defaults 
Then, edit /etc/postfix/main.cf and set inet_interfaces to loopback-only

inet_interfaces = loopback-only

Finally, restart postfix:

sudo service postfix restart

That's it! You are good to go!

10 Day Business / Leisure Trip to the United States (New York & Philadelphia)

A short 10 day trip to the United States, visiting 3 states (New York, New Jersey, and Pennsylvania) 

Long story short - I had to fly to the United States for one reason - opening a bank account (see: How To Open A Bank Account in the U.S., As A Non-resident Non - citizen, Wells Fargo Bank), for the flight, we decided to go with Ukrainian airlines from Tbilisi via Kyiv to New York City (see: About Tbilisi - Kyiv - New York Flight by Ukrainian Airlines) 

Unplanned flight delay in Kyiv happened for 10 hours, during which I managed to craft a short day trip to Kyiv (see: Short Day Trip To Kyiv, Ukraine) 

Once in the States, on the second day's evening, I was able to handle my financial-related things and it was time for leisure. For the first day's stay, we booked a cheaper hotel in Secaucus, offering a fast and convenient connection to downtown Manhattan reachable in about 20 minutes ($6 per ride in a public bus).

Did some shopping and sightseeing around Manhattan (bought lovely leather shoes from Aldo store)

On January second we bought a bus ticket to Philadelphia (again, traveling in the US by public transport is very cheap, as we paid about $15 for a single ticket). Once in Philly, booked a lovely hotel in the downtown area (China town) just a few blocks away from Reading Terminal market. Philly is amazing for leisure, calm and tranquil. Highly recommend.

Returned to New York City, this time booked a luxury hotel near the Empire State building and enjoyed slow days in Manhattan, trying out local Asian cuisine.

Here I'm listing all major and interesting places we discovered this time in America.

Speaking of expenses, I didn't count after all, but now looking back it seems it was at about $4,000

How To Override Drupal 8 Frontpage Title

Recently I've started a new Drupal 8 website for a personal project tour listings in Georgia.  As I've been a core Drupal 7 user since 2011, Drupal 8 involves a new learning curve even for me. In this short article I will provide a quick setup how to override Drupal's 8 frontpage title tag using metatag module

In general frontpage of your website should include main keywords for SEO, by default Drupal 8 shows Home | [site:name], which is not very SEO friendly in fact, as what we would love to achieve is to have Your Keywords | [site:name]. 

For example: Best tours in Georgia and Tbilisi - Tourgeorgia.

It took me some time to figure it out, as I didn't find any place in site configuration where I could play with these settings, and ended with installing a very useful module - Metatag, which is good both for SEO and Social Media sharing (as here you can define your custom settings for Facebook, Twitter and even Google SERP results)

For the ease of this simple tutorial let's stick with overrding site name more SEO friendly.

  • Download and enable Metatag module
  • Under Metatag options (admin/config/search/metatag) scroll down to Front page settings
  • Edit Page title, by entering your keywords 

Hope it helps!