ninetailed-inc / ninetailed-examples

marketing-contentful-next-demo.vercel.app
11 stars 11 forks source link

What is a valid isExperienceEntry argument? #40

Closed spiceee closed 1 year ago

spiceee commented 1 year ago

Hi,

I'm passing an object created by your Contentful app to the ExperienceMapper.isExperienceEntry() helper, and it returns false.

Could you help me to identify why this is not a valid experiment/experience?

I'm currently using:

        "@ninetailed/experience.js-next": "^4.2.3",
        "@ninetailed/experience.js-plugin-google-tagmanager": "^4.2.3",
        "@ninetailed/experience.js-plugin-preview": "^4.2.3",
        "@ninetailed/experience.js-utils-contentful": "^4.2.3", 

Thanks.

Fabio.

    "nt_name": "Hero CTA experiment",
    "nt_description": "Hero CTA experiment",
    "nt_type": "nt_experiment",
    "nt_config": {
        "traffic": 0.08,
        "components": [
            {
                "baseline": {
                    "id": "32n5ngJEedVsDmiSAZk7Ik",
                    "title": "Block Jams Vol 2 Tout"
                },
                "variants": [
                    {
                        "id": "5Fc5q6egIt4Xqgw7j7Yq4a",
                        "hidden": false
                    }
                ]
            }
        ],
        "distribution": [0.5, 0.5]
    },
    "nt_audience": {
        "nt_name": "Test Audience",
        "nt_rules": {
            "any": [
                {
                    "all": [
                        {
                            "type": "isReturningVisitor",
                            "count": "1",
                            "key": "",
                            "operator": "equal",
                            "value": true,
                            "conditions": [
                                {
                                    "key": {
                                        "key": "session_count",
                                        "value": "session_count",
                                        "id": "session_count",
                                        "label": "session_count",
                                        "category": {
                                            "name": "session_count",
                                            "label": "session_count",
                                            "type": "session_count"
                                        },
                                        "useOnce": true
                                    },
                                    "operator": "greaterThan",
                                    "value": "1"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        "nt_audience_id": "19A0dLaKWrPlWyLw502pTP",
        "id": "19A0dLaKWrPlWyLw502pTP",
        "contentTypeId": "nt_audience"
    },
    "nt_variants": [
        {
            "entryTitle": "[Ninetailed Variant] Block Jams Vol 2 Tout",
            "headline": "Switch to Smash-Hit Slices",
            "richHeadline": {
                "data": {},
                "content": [
                    {
                        "data": {},
                        "content": [
                            {
                                "data": {},
                                "marks": [],
                                "value": "Switch to ",
                                "nodeType": "text"
                            }
                        ],
                        "nodeType": "paragraph"
                    },
                    {
                        "data": {},
                        "content": [
                            {
                                "data": {},
                                "marks": [],
                                "value": "Smash-Hit ",
                                "nodeType": "text"
                            }
                        ],
                        "nodeType": "paragraph"
                    },
                    {
                        "data": {},
                        "content": [
                            {
                                "data": {},
                                "marks": [],
                                "value": "Slices",
                                "nodeType": "text"
                            }
                        ],
                        "nodeType": "paragraph"
                    }
                ],
                "nodeType": "document"
            },
            "bodyCopy": "Slices so good, they inspired a summer album! So cool!",
            "ctaButton": {
                "entryTitle": "Let’s Jam",
                "cta": {
                    "entryTitle": "Let’s Jam",
                    "text": "Let’s Jam",
                    "link": {
                        "as": "block-jams",
                        "id": "bPz9x7RhsPUBKQJlii9BV",
                        "contentTypeId": "manualLink"
                    },
                    "theme": "outlinedBlue",
                    "id": "4vRQtBBYAmzhTzjtiNK7fS",
                    "contentTypeId": "cta"
                },
                "theme": "filledBlueHoverCream-ultrabold",
                "id": "2ePRIvLKi70Dz3SVzvroBy",
                "contentTypeId": "ctaButton"
            },
            "image": {
                "title": "blockjams-tout-mobile",
                "description": "",
                "file": {
                    "url": "//images.ctfassets.net/j8tkpy1gjhi5/6AJR6ErmbNtIkQ6N5Un5lH/deb0f83fec518dfa78f731f76123ea86/something.jpg",
                    "details": {
                        "size": 887582,
                        "image": {
                            "width": 710,
                            "height": 710
                        }
                    },
                    "fileName": "something.jpg",
                    "contentType": "image/jpeg"
                }
            },
            "imageLarge": {
                "title": "blockjams-tout",
                "description": "",
                "file": {
                    "url": "//images.ctfassets.net/j8tkpy1gjhi5/6AJR6ErmbNtIkQ6N5Un5lH/deb0f83fec518dfa78f731f76123ea86/something.jpg",
                    "details": {
                        "size": 2451431,
                        "image": {
                            "width": 1248,
                            "height": 1248
                        }
                    },
                    "fileName": "something.jpg",
                    "contentType": "image/jpeg"
                }
            },
            "id": "5Fc5q6egIt4Xqgw7j7Yq4a",
            "contentTypeId": "blockHeroTwoColumn"
        }
    ],
    "id": "1tjkhxDYpZgNCisfFkENkd",
    "contentTypeId": "nt_experience"
}
spiceee commented 1 year ago

Never mind,

I forgot we override and dump sys fields from Contentful.