Skip to main content

    Build custom functions with Code

    Course overview
    Lesson
    3 min read

    Start building with Code

    Transform your ideas into solutions by brainstorming and implementing your first Code function.

    Build your first function

    Now that you’ve seen the Code editor in action as well as some of the things that can be accomplished with Code, it’s time to leverage Code functions to help out your business. Follow the steps below to build your first function.

    Brainstorm use cases

    You’ve seen some examples of how Code functions helped out other businesses, but how can Code functions help you achieve your business goals?

    Come up with 3 examples of how a Code function can help your business goals. These use cases can help serve as a starting point to expanding your business with Code.

    You can be as ambitious and creative as you would like here. The idea here is to get thinking about all of the possibilities that Code enables, so be creative and keep in mind the fact that you can use modules to interact with features outside of Klaviyo.

    Implement a function

    Once you have your ideas, create and deploy a function that accomplishes one of these ideas. Please note that you will need to have some knowledge of Python or JavaScript in order to write your function.

    If you need an idea and still want to try your hand at implementing a function, write a function that takes event data and saves it as a profile property. This is especially useful for nested event data, which cannot be used for segmentation until it is saved as a profile property or top-level event data.

    Share your work

    Send us a link to your brand new live function and a brief description of how it is helping you, and you will be entered in a contest to win some Klaviyo swag! You can submit your functions by posting them to this Community post.

    Please note that we can only send swag for new functions rather than modifications of pre-built recipes or functions that implement the event data to profile property example described above.

    If you have some great ideas and have not yet implemented them, we still want to hear your ideas! Please post your ideas here on the same Community thread to get feedback from and get inspired by other developers.

    We want to see what you're working on! Post a brief description of your function and a link to the function on this Community post for the chance to win some Klaviyo swag. More details within the Community post.

    You can also use the Developer group to network with other Klaviyo developers, get inspired, and ask questions about Code or any aspect of developing with Klaviyo.

    Start building with Code