GithubHelp home page GithubHelp logo

isabella232 / visitor-server-sample-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adobe-marketing-cloud/visitor-server-sample-app

0.0 0.0 0.0 4.52 MB

An isomorphic sample app that implements `@adobe-mcid/visitor-js-server`.

License: Apache License 2.0

JavaScript 99.91% CSS 0.09%

visitor-server-sample-app's Introduction

Visitor sample app

An isomorphic sample app that implements @adobe-mcid/visitor-js-server.

Features:

  • Generate page on the server
  • Implement Adobe Target server side to generate targeted content
  • Implement Visitor#generatePayload to generate a stitch ID on the server
  • Implement the optional Visitor#setCustomerIDs to add custom IDs
  • Implement Visitor#getState to share Visitor state on the server with the client side VisitorAPI library. In this app we are showing the manual implementation of sharing the state. There's a DTM specific implementation below.
  • We share the state with the client side VisitorAPI library to allow stitching the server-side Target call with the client-side Analytics hit.
  • Makes multiple calls to Target for multiple mboxes.

Share state with client side VisitorAPI if using DTM

Replace line 12 - 22 in /components/home.jsx with the following:

    <script dangerouslySetInnerHTML={{__html: "var serverState = " + JSON.stringify(serverState) }} />
    <script src="sattelite.js"/> // DTM script

And configure DTM to add a new setting:

serverState = %serverState%

Run application

git clone [email protected]:Adobe-Marketing-Cloud/visitor-server-sample-app.git

npm run start in your terminal, open your browser and go to localhost:5000

visitor-server-sample-app's People

Contributors

jfkhoury avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.