API - Common

    API - Common


    Article summary

    AccessKey Setting

    Set the issued Access Key.

    ShopLiveCommon.setAccessKey(accessKey : String?)

    User Authentication

    Simple Authentication

    ShopLiveCommon.setUser(user: ShopLiveCommonUser)

    ShopLiveCommon.setUser(user: ShopLiveCommonUser, accessKey:String?)

    Store user information. Please refer to the User Authentication Guide for details

    When user information is saved, a userJWT is automatically created and stored using the user’s information.

    ShopLiveCommon.setuser(user : ShopLiveCommonUser,accessKey:String?)

    • ShopLiveCommonUser

      field

      type

      description

      userId

      String

      User ID

      name

      String?

      User Name

      (Used in the chat window)

      age

      Int?

      User age

      gender

      ShopliveCommonUserGender

      User gender

      userScore

      Int?

      User rating

      custom

      [String: Any]

      Custom data

    πŸ“˜/γ…‘γ…œ/       

    In the Objective-C environment, please use the ShopLiveCommonUserObjc object.

    JWT Authentication

    ShopLiveCommon.setAuthToken(authToken : String)

    Authenticate ShopLive JWT.

    ShopLiveCommon.setAuthToken(jwt : String)

    Clear Authentication Information

    Reset the configured authentication information.

    ShopLiveCommon.clearAuth()

    Logged-in Check

    Determine if JWT login has occurred.

    if ShopLiveCommon.isLoggedIn() {
      // Do something
    }

    Set Utm Tag

    ShopLiveCommon.setUtmSource(utmSource: String)

    ShopLiveCommon.setUtmMedium(utmMedium: String)

    ShopLiveCommon.setUtmCampaign(utmCampaign: String)

    ShopLiveCommon.setUtmContent(utmContent: String)

    You can track UTM Source/Medium/Campaign/Content. The data can be reviewed in the Data Insights.

    func setUtmSource(utmSource: String?)
    func setUtmMedium(utmMedium: String?)
    func setUtmCampaign(utmCampaign: String?)
    func setUtmContent(utmContent: String?)

    field

    type

    description

    utmSource

    String?

    It provides information on where the incoming traffic originated.

    utmMedium

    String?

    It conveys how the incoming traffic was generated. Google recommends setting the medium parameter to denote the marketing method through which the traffic was induced, such as CPC, banner, email, blog, social, etc.

    utmCampaign

    String?

    It communicates which advertising campaign the incoming traffic originated from. This can be divided into Campaign Name, Term, and Content.

    utmContent

    String?

    It informs about the posting/advertisement that led to the incoming traffic, often utilized as a subcategory under the campaign parameter.

    Sample code

    ShopLiveCommon.setUtmSource(β€œ{utm_source}”)
    ShopLiveCommon.setUtmMedium(β€œ{utm_medium}”)
    ShopLiveCommon.setUtmCampaign(β€œ{utm_campaign}”)
    ShopLiveCommon.setUtmContent(β€œ{utm_content}”)