Inline campaigns (Jetpack Compose)

Inline campaigns are informational notes that are embedded directly into your application's existing user interface. Unlike pop-ups or overlays, these views live within your page layout. Initially, they are hidden and have a height of 0 px. When a campaign is triggered, the view expands with an animation to reveal the content, which typically includes a headline and message. The following image shows an example inline campaign.  

Mobile shopping interface showing an inline campaign alert box that reads: Not many left. This item is going fast. Don't miss out!

Note: The steps in this article apply only to Jetpack Compose. For Android Views inline campaigns, see the Android Views implementation topic.

How inline campaigns work

After you add the campaign components to your layout, the SDK handles the rest automatically:

  • Discovery: When the Granify.trackPageView(...) method is called, the SDK scans the current activity to identify all available GranifyInlineComposable locations.
  • Matching: If the Contextual Commerce server matches the current shopper to a campaign, it instructs the SDK to activate a specific location on the page.
  • Expansion: The SDK locates the correct component, initializes the campaign content, and expands the view for the user to see.

Topics in this section 

Select a topic to begin your integration:

Topics 
Description

Implement inline campaigns

Steps to implement Contextual Commerce inline campaigns in your Android application.

Test inline campaigns 

Describes how to validate your integration by forcing campaigns to appear in specific locations.

Provide feedback button