Apxor
IntegrationProduct Guides
  • Introduction to Apxor
  • Getting Started with Apxor
    • Adding a New App
    • Firebase Credentials (optional)
    • SDK
      • Android (x)
      • iOS SDK
      • iOS SDK (Swift UI)
      • iOS SDK (Manual)
      • Web npm based
        • Tracking Events and Pages for Web
      • Web URL based
        • Tracking Events and Pages for Web
      • React Native
      • Cordova
      • Flutter
      • Jetpack Compose
    • API Guides
      • iOS
      • Web
      • React Native
      • Cordova
      • Flutter
    • Release Notes
    • Performance
    • Troubleshooting
  • Product Guides
    • Integration Checklist
    • Create a Campaign
      • Mobile
        • Target
        • Trigger
        • Schedule and Limit
        • Review and Test
        • Set Priority and Publish
        • A/B Testing
        • Campaign Listings Page
        • Campaign Analytics
        • Campaign Designs
          • Tooltips
          • In-App Messages
          • Coachmarks
          • Badges
      • Web
        • Target
        • Trigger
        • Schedule and Limit
        • Review and Test
        • Set Priority and Publish
        • A/B Testing
        • Campaign Listings Page
        • Campaign Analytics
        • Web Templates
    • Create a Survey
      • Legacy
        • Target
        • Trigger
        • Schedule and Limit
        • Review and Test
        • Publish
        • Survey Listings Page
        • Survey Analytics
        • Survey Designs
          • Request for Survey
          • Single Response
          • Multi Response
          • Rating
          • Short Answer
          • Success Message
      • Latest
        • Survey Stop Conditions
        • Target
        • Trigger
        • Schedule and Limit
        • Review and Test
        • Publish
        • Survey Listings Page
    • Custom Reports
    • Analytics
      • Custom Dashboards
      • Uninstalls
      • Retention
      • Funnels
      • Paths
      • Event Analysis
    • BI Dashboard
      • Frequency
      • Aggregates
      • Trends
      • Pie Chart/Advanced Pie Chart
      • Table
    • Insights
      • Activation Analysis
      • Correlation Analysis
    • Adding a Test Device
    • Preview vs. Test vs. Publish
    • Dynamic Script
  • Partner Integrations
    • Mixpanel
    • MoEngage
    • Amplitude
    • CleverTap
  • Glossary of Terms
  • Video Gallery
  • Beta Features
    • Create Embedded Cards Campaign
    • Create Stories Campaign
Powered by GitBook
On this page
  1. Product Guides

Dynamic Script

You can write a script (a new language that Apxor has created which somewhat looks like Javascript) instead of plain text to substitute user and session properties that you have already logged to Apxor SDK or you can substitute a text element from your application, or hidden text that you set it as a keyed tag (apx_view_tag).

The Apxor Language

The Apxor language looks similar to Javascript with some modifications.

We assume every dynamic param that you want to substitute in a text is a pre-defined variable that you can create upfront in the Script dialogue that Apxor Dashboard provides to you.

We support the following operators and keywords as part of our language specification

Unary Operators

! (Negation)

Logical Operators

&& (Logical AND)

|| (Logical OR)

Mathematical Operators

+ (Arithmetic Addition)

- (Arithmetic Subtraction)

* (Arithmetic Multiplication)

/ (Arithmetic Division)

% (Arithmetic Modulo)

Comparison Operators

< (Less than)

<= (Less than or Equals)

> (Greater than)

>= (Greater than or Equals)

== (Equality)

!= (Not Equality)

contains (Checks if a string contains another string)

Keywords

httpGet, onSuccess, onError will be used to make a HTTP GET API call

format will be used to format a string

if, else will be used to write conditional evaluation

true, false boolean keywords

toInt will be helful to convert double/float values to integer

Examples

Note:

Assume the following variables are defined

  • UserName (User Property)

  • RewardPoints (User Property)

  • IsSubscribed (User Property)

  • Subscribed (API JSON response parameter user.is_subscribed)

  • Simple formatting of the string

format(
  "Hello {}. We are excited to give you {} reward points. You can see these points in the Rewards section:",
  UserName,
  toInt(RewardPoints)
);
  • Conditional Dynamic Text

if (!IsSubscribed && RewardPoints < 500) {
  format(
    "Hello {}, you are just {} points away to get free subscription",
    UserName,
    500 - RewardPoints
  )
} else {
  format("Hello {}, You are already subscribed", UserName)
}
  • API call

httpGet(format("https://your-server.com/your-api?userName={}", UserName))
  .onSuccess(() => {
    if (SubScribed) {
      format("Hello {}, you are already subscribed", UserName)
    } else {
      format("Hello {}, you are not subscribed yet", UserName)
    }
  })
  .onError(() => format("Something went wrong. Try again later"));
PreviousPreview vs. Test vs. PublishNextPartner Integrations

Last updated 10 months ago