광고 연동하기

    광고 연동하기


    The content is currently unavailable in English. You are viewing the default Korean version.
    Article summary

    여러 매체의 광고를 거치게 될때, 딥링크 또는 웹 링크 주소에 쿼리 파라미터를 추가하여 지속적으로 광고를 트래킹 할 수 있습니다.
    아래 예제는 딥링크로 부터 유입된 https://xxxx/yyyy?ak={ACCESS_KEY}&ck={CAMPAIGN_KEY}&utm_source={SOURCE}&utm_medium={MEDIUM}&utm_campaign={CAMPAIGN}&utm_content={CONTENT} 를 가정합니다.

    딥링크 AndroidManafest.XML 설정

    <activity android:name=".DeepLinkActivity">
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            
            <data
                android:scheme="https"
                android:host="xxxx"
                android:path="/yyyy" />
        </intent-filter>
    </activity>

    ShopLive SDK에 쿼리 파라미터 추가하기

    class DeepLinkHandlerActivity : AppCompatActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
    
            val uri = intent?.data
            uri?.let {
                for (paramName in it.queryParameterNames) {
                    val paramValue = it.getQueryParameter(paramName) ?: continue
    
                    // 광고용 query param 추가 {key, value} 
                    ShopLive.addParameter(paramName, paramValue)
                }
    
                val intent = Intent(this, MainActivity::class.java)
                startActivity(intent)
            } ?: run {
                Log.e("DeepLink", "URI is null")
            }
    
            finish()
        }
    }