3.0.1 • Published 5 years ago

linkmink v3.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

Intro

LinkMink 3.0.0 has exported modules, LinkMink and LMElements. The LinkMink module exposes the tracking functionality and LMElements exposes the referral widget LinkMink integration instructions located at https://linkmink.com/integration

Installing

$ npm i linkmink

Getting started with LinkMink tracking

  • Step 1: Tracking referrals LinkMink is initialized with the string 'v3'. Then, anywhere you want to accept referrals run the initTracking function. This will listen for referrals and track cookies across your domain and all your subdomains. Example:
import { LinkMink } from 'linkmink';
const lm = LinkMink('v3')
lm.initTracking()
  • Step 2: Tracking Conversions To track a conversion to your referral program, just call the provided conversion() function and store the returned value to be passed into Stripe in step 3. If you are using the LinkMink refer-a-friend program, the conversion() function needs an options parameter. Pass in the Stripe coupon id that you want to apply to your referring customer. The referring customer is your current customer who referred their friend.

If you Example:

const lm = LinkMink('v3')
// Refer a friend program
const referralData = lm.conversion({ coupon: 'dQlkulUS' })

// Affiliate program
const referralData = lm.conversion()
  • Step 3: Pass the referral data to Stripe Pass the value returned from conversion() into Stripe's metadata field on the subscription, customer or invoice. More LinkMink integration instructions located at https://linkmink.com/integration

Getting started with LinkMink Elements (refer a friend widget)

Step 1: Init the exported LinkMink module with 'v3'. It will depend on how it the package was required.

Example js: const lm = linkmink.LMElements('v3');

Example ts: const lm = LMElements('v3');

Step 2: Generate a referral link

Using your customers' Stripe customer ID, generate a referral link (this is how we will know who made the referral). The generateReferralLink function takes a Stripe Customer ID and a base URL (the URL destination for the referral link). // Example: const referralLink = lm.generateReferralLink(user.stripeCustomerID, 'https://example.com/');

Step 3: Load the widget

The loadWidget function takes the referral link generated from Step 4, a title string, and an offer string. Make sure that the linkmink_element is already in the DOM by the time you load the widget.

Example: lm.loadWidget(referralLink, 'Refer a Friend', "For each paying customer you refer, you'll get 10% off.");

// This is an example implementation
(() => {
   const lm = LMElements("v3");
   const referralLink = lm.generateReferralLink('cust_abcd1234', 'https://chartmonkey.com/');
   lm.loadWidget(referralLink, "Refer a Friend", "For each paying customer you refer, you'll get 10% off ChartMonkey.");
})()

Updating to 3.0.0

  • Update to initialzed LinkMink namespace
  • Update lmFinished to LinkMink('v3').conversion()
  • Update lmOnLoad to LinkMink('v3').initTracking()

Updating to 2.0.0

  • Update onLoad to lmOnLoad
  • Update Stripe metadata from identifier to lm_data

Log

  • 3.0.0 Added referral widget and changed the way LinkMink in initialized
  • 2.2.0: Added ability for affiliates to tag referrals via lm_meta
3.0.1

5 years ago

3.0.0

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago