CommuteStream SDK Setup

The following instructions will get you started serving CommuteStream ads in your app. More advanced users may want to skip directly to one of the Quick Links on the right.

I. Create CommuteStream Ad Unit(s)

Follow these instructions to create a CS Ad Unit. You may need to create several depending on your needs.

  1. If you don't already have one, create a CommuteStream publisher account, then sign in and navigate to the Apps page.
  2. Click the New App button in the top right corner.
  3. Enter the name of your app, select the appropriate mobile platform, and click Save.
  4. Click New Ad Unit.
  5. Enter a name for the ad unit. Depending on the ad format, select either Banner or Native and click Save.

    The system will return a new Ad Unit ID which you will need for the steps below.
  6. Repeat the process to add additional apps and ad units as needed. If you'll be using mediation, you will typically want one CS Ad Unit for each AdMob/MoPub Ad Unit in your app. Please note that new ad units may take up to 24 hours for approval.

II. Setup Mediated Ad Unit(s)

CommuteStream works with both AdMob and MoPub mediation, allowing your app to serve banners from other networks when we don't have one. We recommend MoPub for flexibility, but AdMob is also a great choice. If you haven't already you can signup for AdMob here or MoPub here.

AdMob

These steps demonstrate how to setup CommuteStream as an Ad Source in AdMob, thereby linking your Ad Units between CommuteStream and AdMob. You will need to have one or more working AdMob ad unit(s) with corresponding CommuteStream Ad Units made in the previous step.

  1. Log into the AdMob interface.
  2. Click on Monetize tab of main menu.
  3. Click on All apps in left column, then select the app you want to monetize with CommuteStream.
  4. On the right side of the screen click the ad sources link next to the ad unit you wish to add CommuteStream to.
  5. Click + New ad network
  6. Click + Custom Event, then enter the following in the three fields that pop up, and click Continue:
    1. Class Name: com.commutestream.sdk.admob.AdMobBannerAdapter(for Android) CSCustomBanner(for iOS)
    2. Label: CommuteStream
    3. Parameter: <Your Ad Unit ID obtained in step 5>
  7. Change the eCPM for CommuteStream to $4.00; and we recommend turning Ad Optimization off. This will give our ads the proper priority, and maximize your total revenue.
  8. Repeat the above steps for each additional ad unit you want to link to CommuteStream.

MoPub

These steps demonstrate how to setup CommuteStream as a Network in MoPub and link your Ad Units between CommuteStream and MoPub. You will need to have one or more working MoPub ad unit(s) with corresponding CommuteStream Ad Units made in the previous step.

  1. Log into the MoPub Dashboard.
  2. Click on the Networks tab at the top of the page.
  3. Click on the Add a Network button.
  4. Select Custom Native Network.
  5. At the top of the page type CommuteStream as the Title.
  6. Under the Set Up Your Inventory section you will see a list of your MoPub ad units. You must add the following to each ad unit you want to use with CommuteStream:
    1. Box 1 (CUSTOM EVENT METHOD): <LEAVE BLANK>
    2. Box 2 (CUSTOM EVENT CLASS): com.commutestream.sdk.mopub.MoPubBannerAdapter(for Android) CSMoPubCustomEvent(for iOS)
    3. Box 3 (CUSTOM EVENT CLASS DATA): {"cs_ad_unit_uuid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"} where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is a CommuteStream Ad Unit ID obtained from the steps in part I above.
  7. Click the first Save Section button.
  8. Under the Advanced Settings section you can typically leave the default options in place, including "Run the network automatically (recommended)". Click the second Save Section button.
  9. Click the Segments tab at the top of the page, then click Global Segment.
  10. Set the eCPM to $4.00 for each instance of CommuteStream, and make sure that each are also Enabled and Running.
  11. Repeat the above steps for each additional ad unit you want to link to CommuteStream.

No Mediation

If you want to serve ads exclusively from CommuteStream you can skip this step.

III. Add the CommuteStream SDK to Your Project

Now that the ad units have been configured you can proceed with integrating our SDK into your app. The most up-to-date instructions can be found in the README file of the our github SDK repositories. Please follow the appropriate link below

IV. Review Best Practices

Our Best Practices doc provides further guidance, and can help answer common app-specific questions.