Modern Pricing Destination


Modern Pricing provides intelligent, real-time pricing recommendations for every potential customer visiting your web application.

This destination is maintained by Modern Pricing. For any issues with the destination, please reach out to their team.

NOTE: The Modern Pricing Destination is currently in beta, which means that they are still actively developing the destination. This doc was last updated on November 6, 2019. If you are interested in joining their beta program or have any feedback to help improve the Modern Pricing Destination and its documentation, please let their team know!

Getting Started

  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “Modern Pricing” within the Destinations Catalog and confirm the Source you’d like to connect to.
  3. Drop in the “Base64 Decoded Key” into your Segment Settings UI which you can find from your Modern Pricing API Credentials page. Note: You must click on the active API Key Value to view the Base64 Decoded Key.

Page

Page calls are the only type of call supported by Modern Pricing. Your Page calls must:

  1. Be sent from a server-side source, not the default Segment analytics.js snippet.
  2. Pass along at least an ip_address in the context object. You may optionally provide the user_agent parameter for more accurate scoring.

    Parameter Required Description
    ip_address true The ip address of the visitor you want to score.
    user_agent false The software client acting on behalf of the visitor.

The IP Address and User Agent are not automatically collected by Segment’s server-side libraries and you will need to manually grab these fields from the client and pass them to the server. 

An example call would look like:

analytics.page(
  user_id: current_user.id.to_s,
  context: {
    ip_address: request.remote_ip,
    user_agent: request.user_agent
  },
  properties: { 
    url: request.original_url,
    path: request.path,
    referrer: request.referrer
  }
);

Page calls will be sent to Modern Pricing as a pageview. If you haven’t had a chance to review our spec, please take a look to understand what the Page method does.

Optional Best Practices

Modern Pricing recommends the following best practices to reduce unnecessary calls to their API that will count against your monthly usage.

For anonymous visitors:

  • Check that the visitor’s User Agent is not a bot.
if user_agent != bot
  // Send Page call
  analytics.page(
  ...
  );
end

For logged in visitors:

  • Save the Modern Pricing score on your user model so you ensure a consistent user experience.
# == Schema Information
#
# Table name: users
#
# id                      :bigint(8)
# first_name              :string
# last_name               :string
# email                   :string
.
.
.
# modern_pricing_score    :string
#

Identify Postback

When you integrate Modern Pricing via Segment, Modern Pricing returns a postback Identify call to your source so that you’ll be able to easily pass the score to your downstream destinations.

How does it work?

  1. You send a Page call from your server-source like normal.
  2. Modern Pricing then recognizes your Page call and automatically returns and Identify call with the modern_pricing_score trait.

Segment is then able to send the Modern Pricing score to the other destinations you have connected to your source.

Settings

Segment lets you change these destination settings from your Segment dashboard without having to touch any code.

API Key

Click “API Credentials”, then click on the row of the active API key to find your Base64 decoded key for Segment.

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account