Senin, 18 September 2023

3 Necessary Tools for the High Rolling Affiliate Marketer

 3 Necessary Tools for the High Rolling Affiliate Marketer



What does it take to become a successful Affiliate Marketer? What are the ingredients of an affiliate marketing success story? Is there a shortcut to Affiliate Marketing glory? All these questions play around in the minds of affiliate marketers who want to make it big in this business. 

Although affiliate marketing is touted as one of the easiest and most effective ways to earn money online, it is not as easy as it sounds. The wise affiliate marketer plans every action and executes it the best way he can. He should also maximize the potential to earn by utilizing the right tools necessary for a successful Affiliate Marketing business. We have consulted some of the most successful affiliate marketers in the business and below are the top three necessary tools for a successful affiliate marketing business.


Important Tool #1: Your Own Website

The most important and indispensable tool in Affiliate Marketing is your own website. The first step in any successful affiliate marketing business is building a good, credible and professional looking website. Your website is the jump off point of all your marketing efforts. Thus, you must first build a user-friendly website, which will appeal to your prospects and encourage them to click on the links to the products and service you are promoting and make a purchase. Therefore, you must first concentrate your efforts in building a website that will cater to what your prospects need. 

The most important thing you should consider is that almost all web users go online to look for information, not necessarily to go and buy something. Above all else, make your website full of original, relevant and useful content. People will love articles that are appealing and helpful. Keep in mind that, in the internet, content is still king and good quality content will not only build your credibility, it can also help you achieve a higher search engine ranking. By posting relevant and useful articles, you establish yourself as a credible expert in the field, making you a more trustworthy endorser of the product or service you promote. Establishing a good reputation is a good step in building up a loyal consumer base.


Important Tool #2: Incentives

Competition is extremely tight in the internet world. You must always be one-step ahead of your rivals to ensure that you capture a significant share of your target market. Therefore, you must use every possible means to encourage people not only to visit your site but also to click and proceed to the websites of the products and services you are promoting. Building an opt-in email list is one of the best ways to gather prospects. Offer a newsletter or an e-zine. Better yet, offer incentives to your prospects to encourage them to subscribe to your newsletters. You can present free softwares, access to exclusive services and other freebies that will be helpful to your prospects.


Important Tool #3: Link Popularity

The importance of driving highly targeted traffic to your website cannot be emphasized enough. The all-important web traffic is at the top of the list of the most important entities in the internet world. Attracting people to your site should be the first step you should carry out. Do everything to achieve a high search engine ranking. Link Popularity is one of the factors that search engines use to determine search engine rankings. Therefore, to enhance your link popularity, you must launch an aggressive reciprocal link campaign.

One of the best ways to do this – at no cost at all – is by submitting articles, with your website's link at the resource box, to e-zines and free article sites. You will not only gain exposure, you will also have the opportunity to advertise for free, just include a link back to your site. The more sites you submit your articles to, the better your link popularity is. Make your articles original, relevant and useful so that more websites will pick it up and post it.

These are but three of the many tools that an affiliate marketer can use to maximize earning potential. The possibilities are endless and are limited only by your imagination, creativity, resourcefulness and determination. You can always explore other ideas and adapt other strategies, which you think might help you become a high rolling affiliate marketer.


Minggu, 03 Mei 2020

Belajar Babel Loader Javascript ES6

2020031319583407bf63e74fd402a5583504377dfd8829.png

Apa itu babel atau babel.js? Babel merupakan sebuah transpiler yang bertugas untuk mengubah sintaks JavaScript modern (ES6+) menjadi sintaks yang dapat didukung penuh oleh seluruh browser.

JavaScript merupakan bahasa pemrograman yang berkembang sangat pesat. Komunitasnya besar, dan tiap tahun selalu terdapat versi yang baru. 
Namun perkembangan yang pesat tadi ternyata membutuhkan waktu yang lama untuk diadaptasi oleh browser atau Node.js. Lalu jika kita ingin mencoba sintaks terbaru di JavaScript apakah kita perlu menunggu hingga seluruh browser berhasil mengadaptasi pembaharuan tersebut? Tentu tidak! 
Dengan babel Anda dapat menuliskan sintaks JavaScript versi terbaru tanpa khawatir memikirkan dukungan pada browser. Karena babel akan mengubah sintaks yang kita tuliskan menjadi kode yang dapat diterima browser.
Jika Anda penasaran bagaimana cara babel bekerja, babel menyediakan sebuah playground yang dapat kita manfaatkan untuk mengubah sintaks JavaScript modern (ES6+) menjadi sintaks lama. Untuk mencobanya, silakan Anda buka tautan berikut: https://babeljs.io/repl.
20200313195932ff6b88f0352e20c9c08f27fd89aff700.png
Pada playground tersebut kita juga dapat memilih preset yang kita inginkan. Secara default preset akan mengarah ES2015 (ES6).
Anda sudah tahu  sekilas mengenai babel. Nah pada webpack kita juga dapat menggunakan babel dalam bentuk loader. 
Walaupun webpack secara standarnya dapat memproses berkas JavaScript tanpa perlu bantuan loader, namun proses tersebut tidak mengubah sintaks yang kita tuliskan. 
Artinya jika kita menuliskan sintaks JavaScript modern, maka kita akan menemukannya juga pada berkas bundle.js.
2020031320001286d0cce40a7f1f8ac22836dcbab4867b.png
Walaupun saat ini Google Chrome dan Mozilla Firefox sudah mendukung penulisan sintaks ES6, namun setidaknya kita perlu sedikit peduli terhadap dukungan browser lama seperti Internet Explorer atau browser versi lama lainnya.
Untuk menggunakan babel pada webpack sebagai loader, kita perlu memasang tiga package menggunakan npm pada devDependencies
Yang pertama package @babel/core, yang kedua babel-loader, dan yang ketiga @babel/preset-env.

  1. npm install @babel/core babel-loader @babel/preset-env --save-dev


Package @babel/core merupakan package inti yang harus dipasang ketika kita hendak menggunakan babel, baik pada webpack maupun tools yang lain.
Package babel-loader merupakan package yang diperlukan untuk menggunakan babel sebagai loader pada webpack.
Yang terakhir package @babel/preset-env merupakan package preset yang akan kita gunakan untuk membantu babel-loader dalam melakukan tugasnya. 
@babel/preset-env merupakan preset cerdas yang memungkinkan kita menggunakan sintaks JavaScript terbaru tanpa menetapkan secara spesifik sintaks JavaScript versi apa yang kita gunakan.
Berkas package.json akan tampak seperti ini setelah memasang ketiga package tersebut:

  1. {

  2.   "name": "webclock",

  3.   "version": "1.0.0",

  4.   "description": "",

  5.   "main": "index.js",

  6.   "scripts": {

  7.     "build": "webpack"

  8.   },

  9.   "author": "",

  10.   "license": "ISC",

  11.   "dependencies": {

  12.     "jquery": "^3.4.1",

  13.     "moment": "^2.24.0"

  14.   },

  15.   "devDependencies": {

  16.     "@babel/core": "^7.8.4",

  17.     "@babel/preset-env": "^7.8.4",

  18.     "babel-loader": "^8.0.6",

  19.     "css-loader": "^3.4.2",

  20.     "style-loader": "^1.1.3",

  21.     "webpack": "^4.41.6",

  22.     "webpack-cli": "^3.3.11"

  23.   }

  24. }


Setelah berhasil memasang ketiga package tersebut, langkah selanjutnya kita dapat gunakan babel-loader dan preset-nya pada webpack configuration.

  1. const path = require("path");

  2.  

  3. module.exports = {

  4.     entry: "./src/index.js",

  5.     output: {

  6.         path: path.resolve(__dirname, "dist"),

  7.         filename: "bundle.js"

  8.     },

  9.     mode: "production",

  10.     module: {

  11.         rules: [

  12.             /* style and css loader */

  13.             {

  14.                 test: /\.css$/,

  15.                 use: [

  16.                     {

  17.                         loader: "style-loader"

  18.                     },

  19.                     {

  20.                         loader: "css-loader"

  21.                     }

  22.                 ]

  23.             },

  24.             /* babel loader */

  25.             {

  26.                 test: /\.js$/,

  27.                 exclude: "/node_modules/",

  28.                 use: [

  29.                     {

  30.                         loader: "babel-loader",

  31.                         options: {

  32.                             presets: ["@babel/preset-env"]

  33.                         }

  34.                     }

  35.                 ]

  36.             }

  37.         ]

  38.     }

  39. }


Ketika menerapkan rule untuk berkas .js, jangan lupa untuk menetapkan properti exclude dengan nilai “/node_modules/”. 
Apa artinya? Dengan menetapkan properti exclude itu berarti kita mengecualikan webpack untuk memproses berkas .js yang berada pada folder “node_modules”. 
Hal ini dapat meminimalisir proses yang tidak diperlukan, sehingga mempercepat proses build pada proyek kita.  
Lalu pada penerapan babel-loader juga kita menggunakan properti options dengan menetapkan properti presets di dalamnya. Pada properti presets kita tetapkan preset (dalam bentuk array literas) yang sudah kita pasang menggunakan npm, yaitu @babel/preset-env.
Setelah menggunakan babel loader pada webpack configuration, mari kita coba build dan buka kembali berkas bundle.js
Maka kode yang kita tuliskan dalam ES6 akan diubah dalam sintaks yang dapat diterima oleh seluruh browser.
20200313200507f7a720e39de819c62a15f1be147aa62e.png
Bahkan pada berkas bundle tersebut dipastikan sudah tidak terdapat lagi sintaks yang dituliskan menggunakan ES6.
20200313200535f035aab9b99622b9e95be3f0d98fc827.png
Namun walaupun sintaksnya sudah diubah, proyek akan tetap berjalan normal seperti biasanya.
Contoh: 
https://github.com/dicodingacademy/a163-bfwd-labs/tree/207-webclock-webpack-using-loader

Rabu, 29 April 2020

Contoh Menggunakan API Dan Fetch di dalam Web Sederhana

Apakah Anda sudah berhasil menerapkan Fetch dalam menampilkan data dari API TheSportDB? Jika belum, yuk kita lakukan bersama-sama!
Pada dokumentasi API menyebutkan bahwa, untuk mendapatkan daftar klub olahraga kita dapat menggunakan target url: https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=Arsenal
2020031323502200000abb4fd3bf7637506d2872ff1cb0.png
Sebelum menuliskan langsung pada proyek dengan fetch, biasakan ketika hendak mengkonsumsi API biasakan untuk mencobanya menggunakan aplikasi Postman terlebih dahulu. Jika target url tersebut diakses melalui Postman dengan GET Request, maka akan menghasilkan response dengan struktur JSON yang tampak pada tab Body.
202003132350321a588cd4b3f0285be6fd1af52fa3591e.png
Pada response JSON yang dihasilkan menampung satu key dengan nama teams yang memiliki value berupa sebuah array. Di dalam array tersebut menampilkan banyak data terkait klub olahraga yang memiliki nama Arsenal. Kita dapat memanfaatkan key strTeam untuk mendapatkan nama klub, strTeamBadge untuk mendapatkan logo klub, dan strDescriptionEN untuk mendapatkan deskripsi singkat dalam bahasa inggris.
Lantas untuk mencari data team berdasarkan kata kunci lain kita dapat mengubah kata “Arsenal” menggunakan kata kunci yang kita inginkan, misalnya “Barcelona”. Sehingga melakukan request terhadap url: https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=Barcelona akan menghasilkan response JSON dengan informasi klub olahraga terkait “Barcelona”.
20200313235048e7906db6f58df01a750d175c26f3b342.png
Cukup mudah bukan untuk menggunakan API tersebut?
Nah, Setelah memahami cara penggunaan API-nya, sekarang mari kita mulai tuliskan fungsi fetch pada proyek Club Finder. Langkah awal buka kembali proyek Club Finder pada text editor yang Anda gunakan.
202003132351017c49f82cb83c52af812adb0b076cc23f.png
Kemudian buka berkas data-source.js pada src -> script -> data -> data-source.js. Kita refactor fungsi searchClub dengan menghapus seluruh logika yang ada di dalamnya, kemudian tuliskan fungsi fetch seperti ini:

  1. class DataSource {

  2.    static searchClub(keyword) {

  3.        return fetch(`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`)

  4.    }

  5. }

  6.  

  7. export default DataSource;


Seperti yang sudah kita ketahui, fungsi fetch() akan mengembalikan promise resolve jika request berhasil dilakukan. Maka untuk menangani respon dari request yang dibuat, kita gunakan .then() yang di dalamnya berisi variabel response sebagai response object yang didapat.

  1. class DataSource {

  2.    static searchClub(keyword) {

  3.        return fetch(`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`)

  4.        .then(response => {

  5.           

  6.        })

  7.    }

  8. }

  9.  

  10. export default DataSource;


Kemudian di dalam blok then tersebut, kita ubah nilai response menjadi JSON dengan memanggil method response.json().

  1. class DataSource {

  2.    static searchClub(keyword) {

  3.        return fetch(`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`)

  4.        .then(response => {

  5.            return response.json();

  6.        })

  7.    }

  8. }

  9.  

  10. export default DataSource;


Karena method response.json() juga mengembalikan nilai promise, maka untuk mendapatkan nilai yang dibawa oleh resolve kita perlu menambahkan .then lainnya (chaining promise). Di dalam .then yang kedua ini, berikan parameter dengan nama responseJson (penamaan variabel tidaklah baku, namun gunakan penamaan yang menunjukkan arti dari nilai variabelnya).

  1. class DataSource {

  2.    static searchClub(keyword) {

  3.        return fetch(`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`)

  4.        .then(response => {

  5.            return response.json();

  6.        })

  7.        .then(responseJson => {

  8.           

  9.        })

  10.    }

  11. }

  12.  

  13. export default DataSource;


responseJson merupakan nilai JSON yang dihasilkan dari perubahan object response dalam bentuk JSON melalui method .json() tadi.
Di dalam block .then yang kedua, kita kembalikan (return) dengan nilai promise resolve dengan membawa nilai jsonResponse.teams jika nilai array tidak null. Namun jika teams bernilai null, maka kembalikan dengan nilai promise reject dengan membawa nilai “${keyword} is not found”.

  1. class DataSource {

  2.    static searchClub(keyword) {

  3.        return fetch(`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`)

  4.        .then(response => {

  5.            return response.json();

  6.        })

  7.        .then(responseJson => {

  8.            if(responseJson.teams) {

  9.                return Promise.resolve(responseJson.teams);

  10.            } else {

  11.                return Promise.reject(`${keyword} is not found`);

  12.            }

  13.        })

  14.    }

  15. }

  16.  

  17. export default DataSource;


Simpan perubahan tersebut dan jalankan aplikasi dalam mode development menggunakan perintah:

  1. npm run start-dev


Setelah proyek terbuka, lakukan pencarian dengan keyword apapun yang Anda mau, di sini kita contohkan dengan “Barcelona”.
20200313235133e90126ea84a6df29dc44b91c4f296331.png
Yah, data yang ditampilkan undefined. Mengapa bisa demikian? Ini disebabkan karena kita belum menyesuaikan key berdasarkan response yang didapat dari public API. Kita harus menggunakan key strTeam untuk mendapatkan nama klub, strTeamBadge untuk mendapatkan logo klub, dan strDescriptionEN untuk mendapatkan deskripsi singkat dalam bahasa inggris.
Ketiga key tersebut kita tetapkan pada berkas src -> script -> component -> club-item.js. Lebih tepatnya pada fungsi render.

  1. render() {

  2.        this.shadowDOM.innerHTML = `

  3.            <style>

  4.                 ……..

  5.            </style>

  6.            <img class="fan-art-club" src="${this._club.fanArt}" alt="Fan Art">

  7.            <div class="club-info">

  8.                <h2>${this._club.name}</h2>

  9.                <p>${this._club.description}</p>

  10.            </div>`;

  11.    }


Kita ubah properti this._club.fanArt menjadi this._club.strTeamBadgethis._club.name menjadi this._club.strTeam, dan this._club.description menjadi this._club.strDescriptionEN.
Sehingga fungsi render akan menjadi seperti ini:

  1. render() {

  2.        this.shadowDOM.innerHTML = `

  3.            <style>

  4.                * {

  5.                    margin: 0;

  6.                    padding: 0;

  7.                    box-sizing: border-box;

  8.                }

  9.                :host {

  10.                    display: block;

  11.                    margin-bottom: 18px;

  12.                    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);

  13.                    border-radius: 10px;

  14.                    overflow: hidden;

  15.                }

  16.               

  17.                .fan-art-club {

  18.                    width: 100%;

  19.                    max-height: 300px;

  20.                    object-fit: cover;

  21.                    object-position: center;

  22.                }

  23.               

  24.                .club-info {

  25.                    padding: 24px;

  26.                }

  27.               

  28.                .club-info > h2 {

  29.                    font-weight: lighter;

  30.                }

  31.               

  32.                .club-info > p {

  33.                    margin-top: 10px;

  34.                    overflow: hidden;

  35.                    text-overflow: ellipsis;

  36.                    display: -webkit-box;

  37.                    -webkit-box-orient: vertical;

  38.                    -webkit-line-clamp: 10; /* number of lines to show */

  39.                }

  40.            </style>

  41.            <img class="fan-art-club" src="${this._club.strTeamBadge}" alt="Fan Art">

  42.            <div class="club-info">

  43.                <h2>${this._club.strTeam}</h2>

  44.                <p>${this._club.strDescriptionEN}</p>

  45.            </div>`;

  46. }


Simpan kembali perubahan kode yang dituliskan kemudian lakukan pencarian kembali pada aplikasi Club Finder. Seharusnya sekarang aplikasi sudah bisa menampilkan data dengan baik.
202003132351502bc06712f0552fa6f26e8f8de5607033.png
Voila! Anda sudah berhasil menerapkan Fetch pada proyek Club Finder.
banner