Skip to main content

Introduction

To display campaign on specifics pages , you have to configure the Beyable Object with the setAttributes method before to call the sendPageView method.

import { EPageUrlType } from "@beyable/sdk";
import { beyable } from "./config/beyable";
beyable.page.setAttributes({
urlType: EPageUrlType.PRODUCT || EPageUrlType.CART || EPageUrlType.HOME || EPageUrlType.CATEGORY || EPageUrlType.TRANSACTION,
pageReferrer: document.referrer,
url: "http://www.my-web-site.com"
}

Attributes details#

attributestypeactions
urlType
stringspecify the type of page
pageReferer
stringfill the referer
url
stringfill url of your web site

urlType#

the urlType value is a set of interface imported from the @beyable/sdk package. it's allow you to specify the type of your current page and change the parameter to set up you setAttributes methode.

valueactions
EPageUrlType.HOMEaccess to homePage attributes
EPageUrlType.CARTaccess to cartPage attributes
EPageUrlType.CATEGORYaccess to categoryPage attributes
EPageUrlType.TRANSACTIONaccess to transactionPage attributes
EPageUrlType.PRODUCTaccess to productPage attributes

In the next section we will sea every attributes in details