BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
288 stars 101 forks source link

can not read parsed data #398

Closed jayonthegreen closed 7 years ago

jayonthegreen commented 7 years ago

url created on marketing tab ( https://dashboard.branch.io/marketing ) can be properly read by code.

branch.init(key, function (err, data) {
  var parsed = data['data_parsed'];
  ///...
}) 

but url created by myself with web-sdk or ios-sdk can not be read

parsed data from marketing link includes many key, value but from link i created with sdk have only +clicked_branch_link:fasle, +is_first_session:true

i think i properly make link here is code for creating my link

// branch.init() already call 
branch.link({
        tags,
        campaign,
        channel,
        feature: 'web',
        data: {
          '$deeplink_path': `foo`,
          '$og_title': `foo`,
          '$og_description':'foo',
          '$og_url': 'https://rememberapp.co.kr',
          '$ios_deepview': 'sharebook_deepview',
          '$desktop_url': `https://rememberapp.co.kr/deeplink`,
          '$android_url': `https://play.google.com/store/apps/details?id=kr.co.rememberapp&utm_campaign=${campaign}&utm_source=${channel}&utm_medium=${tags[0]}`,
          '$ios_url': `itms-apps://itunes.apple.com/app/id840553277?pt=41308801ct=${campaign}_${channel}_${tags[0]}&mt=8`,
          '$rmbr_referrer_id': id, // my custom data
        }
      }, function (err, branchLink) {
        console.log(err, branchLink);
      });
yntema commented 7 years ago

Hi @holdonnn, sorry about the trouble!

I just tried running your code and ran into an error. '$og_description': foo', is missing the opening ' in front of foo. Try that out and let me know if it works :)

jayonthegreen commented 7 years ago

@yntema hi. thank you for your kind sorry, i had some mistake above example code. fix it now.

also i had solved my problem. i misunderstand es6 literal for passing data to branch.link.