Collect event data
Prepr is a data-driven CMS, meaning you can capture events, store and process big data. With this, we enable you to segment your customers and personalize content for them.
Every event is associated with an event type; the time it happened, the customer that caused the event, and optionally some metadata. Events can be created using the Prepr Tracking Code or the REST API.
Event types
Event types are specifying the kind of event the customer has with your content. For example when a customer views a post
a View
event is recorded.
Constraint events can only be created once in a Customer-Content relationship.
Type | |
---|---|
View | |
Like | |
Dislike | |
Comment | |
Bookmark | |
Subscribe | |
Purchase | |
Vote | |
Clickthrough | |
Share | |
SignUp | |
Unlike | |
Unbookmark | |
Unsubscribe | |
Unvote |
Recording events using the Tracking Code
Adding the Tracking Code
Prepr uses a lightweight piece of javascript to capture events: the Prepr tracking code.
- Go to Settings > Tracking code.
- Click Copy code to get a ready-to-use Prepr tracking code and add it to the <head> section of your website.
If you don't have a tracking code in your environment settings, click here to learn how to create it manually.
Once you've added the tracking code, proceed with recording events.
Recording events
To start tracking events on content items, add the following meta property tag to the <head>
on all content pages.
Replace the content of the property with the content ID. If the prepr:id
property is present, a View
event will be recorded on page load.
<meta property="prepr:id" content="16c63a1e-e837-4951-bd9a-b933a8d14b2f"/>
To associate an event with an existing customer, an optional meta property tag can be added to the page. If your site uses an identity provider you can use that customer ID to track events on.
<meta property="prepr:customer-id" content="16c63a1e-e837-4951-bd9a-b933a8d14b2f"/>
If the customer ID is not found in your customers list when the event gets processed, a new customer will be created. By default, a cookie with a unique ID will be used.
Recording other events
To record events you need to have the Prepr Tracking Code set up. Once added, you can submit an event using the event method. Optional metadata can be sent with the event.
In the example below we send a View event for a published post:
prepr('event', 'Like');
If you have multiple content items on the same page, you can send pass the content item ID within event.
prepr('event', 'Subscribe', { 'id': "16c63a1e-e837-4951-bd9a-b933a8d14b2f" });
Adding custom metadata
All events have a metadata (data) field that allows you to set custom-defined key/value data about an event.
prepr('event', 'SignUp', {
'data':{
'invited_by':'c532586c-1e9c-4f26-b8ba-113178c58133'
}
});
Specifying constraints
Prepr can help to enforce data integrity with the use of constraints. Constraints can be applied to supported event and will guarantee both existence and uniqueness. An event that violates the constraint will be discarded.
The following event types support constraints:
Type | |
---|---|
View | |
Like | |
Dislike | |
Comment | |
Bookmark | |
Subscribe | |
Purchase | |
Vote | |
Clickthrough | |
Share | |
SignUp |
prepr('event', 'Vote', { 'constraint': true });
Search Bots and Prepr
Bots are automated computer programs that click around in a browser, attempting to mimic humans.
Bots can either run on servers in a datacenter such as Amazon Web Services, or sometimes, on people’s personal computers that have been infected with malware or a virus (referred to as a botnet).
Some bots, such as GoogleBot, are used for legitimate purposes such as indexing the web. For more information on how Prepr handles search bots, click here.
Recording events using the REST API
With the REST API you can send event data to Prepr. This can be convenient for offline conversions or if you're working in a restricted environment and aren't allowed to load third-party Javascript snippets.
JSON Structure
The table below shows the fields that are supported in the REST API.
argument | type | required | description |
---|---|---|---|
label | String | Yes | Defines the event type. |
value | Float | Engagement value (default 1). | |
timestamp | UTC Timest. | Event timestamp (default time of request). | |
constraint | Boolean | Enforce constraint. | |
Content Item Data | |||
content_item | Array | Yes | |
content_item.id | String | Yes | Content item ID the event is recorded for. |
content_item.locale | String | Locale like en-GB . | |
Customer Data | |||
customer | Array | Yes | |
customer.id | String | ID of Prepr User | |
Custom Metadata | |||
data | Array | Add custom event data. | |
Metadata | |||
utm_medium | String | Campaign Medium | |
utm_source | String | Campaign Source | |
utm_campaign | String | Campaign Name | |
utm_term | String | Campaign Term | |
utm_content | String | Campaign Content | |
rl | String | Referrer location, example: https://prepr.io/ | |
sr | String | Screen resolution, example: 1680x1050 |
You need to supply a customer ID for the event to be recorded.
If the customer ID is not found in your customers list when the event gets processed, a new customer will be created.
Recording events
If you collected all the data, the JSON data object should be posted to the following endpoint:
POST https://tracking.prepr.io/events
{
"label" : "View",
"timestamp" : 1609588800, // Optional
"content_item" : {
"id" : "76a5e261-ec2a-4bd2-8195-cf7e889b0a68"
},
"customer" : {
"id" : "x-21381723243-PRP"
}
}
This endpoint requires an HTTP Authorization header with an Access Token containing the capture_publish
scope.
If the event was successful queued the endpoint will return a status code 202 Accepted
.
To validate your input, within a few seconds, you'll see the data reflected in the Prepr Engagement page.
Adding custom metadata
All events have a metadata (data) field that allows you to set custom-defined key/value data about an event. An example is shown below:
{
"label" : "View",
"value" : 1,
"timestamp" : 1609588800,
"data" : {
"ref_url" : "/news/liveblog"
},
"content_item" : {
"id" : "76a5e261-ec2a-4bd2-8195-cf7e889b0a68"
}
}
Specifying constraints
Prepr can help to enforce data integrity with the use of constraints. Constraints can be applied to supported event and will guarantee both existence and uniqueness. An event that violates the constraint will be discarded.
The following event types support constraints:
Type | |
---|---|
View | |
Like | |
Dislike | |
Comment | |
Bookmark | |
Subscribe | |
Purchase | |
Vote | |
Clickthrough | |
Share | |
SignUp |
Capturing event data and Search Bots
What are Bots?
A search bot, sometimes called a spider, is a robot that continuously browses the internet, usually for the purpose of building a search index or archiving websites.
Bots can artificially inflate event data, so it’s important to be aware of their existence.
Prepr and Search Bots
Prepr can detect search bots that deliberately reveal themselves. All traffic from known bots and spiders is automatically excluded. This ensures that your Prepr data, to the extent possible, does not include events from known bots. At this time, you cannot disable known bot data exclusion or see how much known bot data was excluded.
Known bot traffic is identified using a combination of our research and the International Spiders and Bots List.
List of excluded bots
Below is a list of search bots and their user-agents that Prepr identifies.
user Agent | Search Bot |
---|---|
200pleasebot | 200PleaseBot |
360spider | 360Spider |
abot | CrawlDaddy, abot |
addthis | AddThis |
adldxbot | Microsoft Bing Ads |
admantx | ADmantX Platform Semantic Analyzer |
adsbot-google | Google Adwords |
advbot | AdvBot |
ahrefsbot | Ahrefs backlinks research tool |
alexa | Alexa Crawler |
apache-httpclient | Java http library |
apachebench | ApacheBench (ab) |
apis-google | APIs-Google |
appengine-google | Google App Engine |
applebot | Apple Bot |
archive.org_bot | Internet Archive (archive.org) |
ask jeeves | Ask Jeeves |
asynchttpclient | Java http and WebSocket client library |
awe.sm | Awe.sm URL expander |
baidu | Baidu |
bdcbot | Big Data Corp |
bingbot | Microsoft Bing |
bingpreview | Microsoft Bing preview |
bitlybot | bit.ly bot |
blekkobot | Blekkobot |
blexbot | BLEXBot (webmeup) |
bot@linkfluence.net | Linkfluence bot |
bufferbot | BufferBot |
buibui-checkbot | buibui |
butterfly | Topsy Labs |
buzztalk | buzztalk |
catchbot | CatchBot (catchbot.com) |
check_http | Nagios monitor |
cliqzbot | Cliqzbot |
cmradar/0.1 | CMRadar/0.1 |
coldfusion | ColdFusion http library |
commoncrawl | CCBot |
comodo-webinspector-crawler | Comodo |
crowsnest | Crowsnest |
curabot | cura.yt |
curl | curl unix CLI http client |
dap/nethttp | DAP/NetHTTP |
datagnionbot | datagnion.com/bot.html |
daumoa | Korean portal and search engine indexing bot |
developers.google.com/+/web/snippet | Google Plus |
diffbot | Diffbot |
digitalpersona fingerprint software | HP Fingerprint scanner |
domain re-animator bot | Domain Re-Animator Bot |
domainsbot | DomainsBot |
domaintunocrawler | DomainTuno |
dotbot | Dot Bot |
duckduck | Duck Duck Go |
elb-healthchecker | AWS ELB HealthChecker |
embedly | Embedly |
eoaagent | EOAAgent |
eventmachine httpclient | Ruby http library |
everyonesocialbot | EveryoneSocial |
evrinid | Evri bot |
exabot | Exalead's bot |
exaleadcloudview | ExaleadCloudView |
facebookexternalhit | Facebook Bot |
facebot | Facebook Bot |
feedburner | RSS bot |
feedfetcher-google | Google Feedfetcher |
findxbot | Findxbot |
flipboardproxy | FlipboardProxy |
friendfeedbot | FriendFeed |
genieo | Genieo Web filter bot |
getprismatic.com | getprismatic.com |
gigabot | Gigabot spider |
gimme60bot | Gimme60 (gimme60.com) |
gimmeusabot | Gimme60 (gimme60.com) |
go http package | Go http library |
google page speed insights | Google Page Speed Insights |
google Web Preview | Google Instant Previews crawler |
google-structured-data-testing-tool | Google-StructuredDataTestingTool |
google-structureddatatestingtool | Google-StructuredDataTestingTool |
googlebot | Google Bot |
googlestackdrivermonitoring-uptimechecks | GoogleStackdriverMonitoring-UptimeChecks |
grapeshotcrawler | GrapeshotCrawler |
gravitybot | Gravity Bot |
hatena::bookmark | Hatena::Bookmark |
heritrix | heritrix |
htmlparser | HTMLParser |
http_request2 | HTTP_Request2 |
httpclient | HTTPClient |
https://developers.google.com/+/web/snippet | Google+ Snippet Fetcher |
hubspot | HubSpot |
ia_archiver | Internet Archive (WayBackMachine) |
icoreservice | iCoreService |
idmarch | idmarch.org/bot.html |
inagist | URL resolver |
insieve | Insieve Bot |
insitesbot | Insitesbot |
instapaper | Instapaper |
istellabot | IstellaBot |
jack | jack |
jakarta commons | Jakarta Commons HttpClient |
java | Generic Java http library |
jetslide | Jetslide |
js-kit | URL resolver |
kemvibot | Kemvi |
kimengi | Kimengi Bot |
knows.is | knows.is |
kojitsubot | Kojitsubot |
komodiabot | KomodiaBot |
kraken | kraken |
laconica | Laconica |
libwww-perl | Perl client-server library |
lijit crawler | Lijit |
linkdexbot | Linkdex Bot |
linkedinbot | |
linkscrawler | LinksCrawler |
linode | Linode Longview |
lipperhey | Lipperhey |
livelapbot | Livelapbot |
loadtimebot | Load Time Bot |
longurl | URL expander service |
ltx71 | ltx71.com |
lumibot | Lumibot |
lwp-trivial | Another Perl library |
magpie-crawler | magpie-crawler |
mail.ru_bot | Mail.ru Bot |
meanpathbot | meanpath |
mediapartners-google | Google Adsense bot |
megaindex.ru | MegaIndex |
memorybot | mignify.com/bot.html |
metauri | MetaURI |
mfe_expand | Mcafee spider |
mir web crawler | MIR web crawler |
mj12bot | Majestic-12 spider |
mojeekbot | Mojeek UK search crawler |
mrchrome | MrChrome |
ms search 6.0 robot | MS Search 6.0 Robot |
msnbot-media | Microsoft media bot |
msnbot | Microsoft bot |
nerdybot | NerdyBot |
netcraft | Netcraft |
netstate | netEstate NE Crawler |
netvibes | Personalized dashboard bot |
netzcheckbot | netzcheck |
newrelicmonitor | NewRelic monitor |
newrelicpinger | NewRelicPinger |
newsme | newsme |
niki-bot | niki-bot |
ning | NING |
nutch | Apache search spider |
openhosebot | OpenHoseBot |
orangebot | OrangeBot |
pagesinventory | pagesinventory.com |
panopta | Monitoring service |
paperlibot | PaperLi |
peerindex | peerindex |
percolatecrawler | PercolateCrawler |
perfectmarketkwtbot | PerfectMarket |
phantomjs | PhantomJS |
pingdom | Pingdom monitoring |
plukkie | botje.com/plukkie.htm |
privacyawarebot | PrivacyAwareBot |
proximic | Proximic Spider |
psbot-page | Picsearch |
publiclibraryarchive.org | publiclibraryarchive.org |
pycurl | Python http library |
python-httplib2 | Python-httplib2 |
python-requests | Python http library |
python-urllib | Python http library |
queryseeker | QuerySeekerSpider |
quicklook | QuickLook |
re-animator | Domain Re-Animator Bot |
readability | Readability |
rebelmouse | RebelMouse |
redditbot | Reddit Bot |
relateiq | RelateIQ |
riddler | Riddler Bot |
rogerbot | SeoMoz spider |
rssmicro | RSS/Atom Feed Robot (rssmicro.com) |
ruby | Ruby |
scrapy | Scrapy |
screaming frog seo spider | Screaming Frog SEO Spider |
searchmetricsbot | SearchmetricsBot |
semrushbot | SEO analysis bot |
seokicks | SEOKicks |
seznambot | SeznamBot |
shopwiki | ShopWiki |
shortlinktranslate | Link shortener |
showyoubot | Showyou iOS app spider |
siege | Joe Dog Siege |
sistrix | SISTRIX |
siteuptime | Site monitoring services |
slack | Slackbot-LinkExpanding |
slackbot | Slack Bot |
slurp | Yahoo spider |
smtbot | SimilarTech |
socialrank | SocialRankIOBot |
sogou | Chinese search engine |
spbot | OpenLinkProfiler |
spider | generic web spider |
spinn3r | Spinn3r aggregator |
sputnikbot | SputnikBot |
squider | Squider |
statuscake | StatusCake |
stripe | Stripe |
test certificate info | C http library? |
tineye | TinEye Bot |
traackr | Traackr Bot |
trendictionbot | Trendiction Search |
turnitinbot | TurnitinBot |
tweetedtimes | The Tweeted Times |
tweetmemebot | TweetMeMe Crawler |
twikle | Social web search bot |
twitjobsearch | TwitJobSearch |
twitmunin | Twitmunin |
twitterbot | Twitter URL expander |
twurly | Twurly |
typhoeus | Typhoeus |
umbot | uberMetrics |
unwindfetch | Gnip |
uptimerobot | Uptime Robot |
vagabondo | Vagabondo |
vb project | Visual Basic |
vigil | Vigil |
vkshare | VKontake Sharer |
voilabot | VoilaBot |
vrcrawler | Venture Radar |
wasalive-bot | Wasalive Bots |
watchsumo | WatchSumo |
wbsearchbot | Ware Bay Best Buys |
webscout | Webscout |
wesee | WeSEE |
wget | wget unix CLI http client |
wordpress | WordPress spider |
wormly | WormlyBot |
wotbox | Wotbox |
xenu link sleuth | Xenu Link Sleuth |
xing-contenttabreceiver | Xing bot |
xovibot | XoviBot |
yacybot | YaCy |
yahoo-ad-monitoring | Yahoo Ad monitoring |
yandex | Yandex |
yeti | Naver Corp |
yourls | YOURLS |
zelist.ro | feed parser |
zibb | ZIBB spider |
zitebot | Zite |
zyborg | Zyborg |