Closed nevstas closed 1 year ago
I found solution.
Branch.initSession().then(function(data) {
var campaign_name = data['~campaign'];
});
I found example of data here https://help.branch.io/developers-hub/docs/attribution-api#handling-deep-link-data
{
"randomized_device_token": "823600311503935224",
"link": "https://example.app.link/X7OsnWv9TF",
"session_id": "429691081177874743",
"data": "{
"$canonical_url": "https://example.com/home?utm_campaign=test",
"$desktop_url": "http://example.com/home",
"$og_description": "My Content Description",
"$og_image_url": "http://lorempixel.com/200/200/",
"$og_title": "46D6D28E-0390-40E4-A856-BD74F34D24C8",
"+click_timestamp": 1503684563,
"+clicked_branch_link": true,
"+is_first_session": false,
"+match_guaranteed": true,
"custom": "blue",
"~campaign": "new launch",
"~channel": "facebook",
"~creation_source": 3,
"~feature": "sharing",
"~id": 429691043152332059,
"~referring_link": "https://example.app.link/X7OsnWv9TF",
"~stage": "new person",
"~tags": ["one","two"]
}"
}
How can I get "campaign name" from traffic source?
Can anybody help me?