Skip to content

Commit

Permalink
personalization
Browse files Browse the repository at this point in the history
  • Loading branch information
hopefourie-nyt committed Apr 13, 2022
1 parent b97fbb6 commit 8f59bbe
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 66 deletions.
4 changes: 2 additions & 2 deletions components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import styles from "./layout.module.css";
import utilStyles from "../styles/utils.module.css";
import Link from "next/link";

const name = "[Your Name]";
export const siteTitle = "Next.js Sample Website";
const name = "Hope's Next.js Example Site";
export const siteTitle = "Hope's Next.js Example Site";

type Props = {
children: React.ReactNode;
Expand Down
214 changes: 214 additions & 0 deletions pages/api/tests.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
const tests = [
{
id: 1,
name: "EXAMPLE_test_1",
config: {
createdAt: "2022-03-26T14:58:23.000Z",
version: 0,
snapshotId: 506,
configVer: 8978,
testConfig: {
reporting: {
metric_model_id: "abra_app",
},
config: [
{
active: true,
integrations: ["ios-core-prd", "ios-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
mobile_interface_idiom: {
is: "phone",
},
},
},
{
active: true,
integrations: ["android-core-prd", "android-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "1_offer",
weight: "0%",
},
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
smallest_width: {
less_than: 600,
},
},
},
],
},
},
},
{
id: 2,
name: "EXAMPLE_test_2",
config: {
createdAt: "2022-03-26T14:58:23.000Z",
version: 0,
snapshotId: 506,
configVer: 8978,
testConfig: {
reporting: {
metric_model_id: "abra_app",
},
config: [
{
active: true,
integrations: ["ios-core-prd", "ios-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
mobile_interface_idiom: {
is: "phone",
},
},
},
{
active: true,
integrations: ["android-core-prd", "android-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "1_offer",
weight: "0%",
},
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
smallest_width: {
less_than: 600,
},
},
},
],
},
},
},
{
id: 3,
name: "EXAMPLE_test_3",
config: {
createdAt: "2022-03-26T14:58:23.000Z",
version: 0,
snapshotId: 506,
configVer: 8978,
testConfig: {
reporting: {
metric_model_id: "abra_app",
},
config: [
{
active: true,
integrations: ["ios-core-prd", "ios-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
mobile_interface_idiom: {
is: "phone",
},
},
},
{
active: true,
integrations: ["android-core-prd", "android-core-stg"],
allocate_by: {
parameter: "abtest_by_agent_id",
variants: [
{
variant: "1_offer",
weight: "0%",
},
{
variant: "0_control",
weight: "0%",
},
{
variant: "1_offer",
weight: "100%",
},
],
abtest_partitioning_key: "APP_2021H1_PLO",
},
targeting: true,
targeting_criteria: {
smallest_width: {
less_than: 600,
},
},
},
],
},
},
},
];

export default function handler(req, res) {
// Get data from your database
res.status(200).json(tests);
}
Loading

0 comments on commit 8f59bbe

Please sign in to comment.