Learn Mokapen

Main menu
Marketing Contact us

Website visits

Website visits tell Mokapen who lands on your site, which campaign they came from, and which pages they open — after they accept measurement cookies. It is not a second analytics tool you open on the side: when that person becomes a contact (a form, a link in an email), the pages they saw land on their card. Sales sees the path, not only “they submitted the form”.

It is not the form, and it is not a Mokapen page. The contact form collects people who write to you. You publish the site pages yourself (your CMS, or Mokapen pages). This guide is the snippet you put on the site and the report you read under Websites.

The point is simple: one script, consent comes from your site’s banner, and the data stays in the organization. No plugin for sales to learn, no Google Analytics export to paste into the address book.

 

What it is for, and why it is worth it

The problem is not “knowing the site has visits”. It is that the visit lives in one tool and the contact in another. Mokapen closes the gap, but only with consent:

  • One snippet, the whole site — copy it from Websites → Tracking and paste it in the theme, the header, or Tag Manager. It covers every page where you load it, not only the form.
  • No visit without a yes — the snippet alone records nothing and does not write the visitor cookie. A visit starts only when your banner calls mkpTracking.consent(true). If the person refuses or withdraws consent, call mkpTracking.consent(false): Mokapen stops and deletes the cookies.
  • Anonymous until they identify themselves — before the form you see visitors, pages and campaigns. The name appears when the email is already in the address book (form submit, or a click on a Mokapen link). Tracking does not create a new contact from a guessed email.
  • Where they came from — utm_source, utm_medium, utm_campaign (and term/content) stay on the event. The report shows first touch, last touch, and a multi-touch only for visitors who were later identified.
  • On the card, not in an export — the contact’s Website tab: how many visits, how many pages, first and last source, latest pages. The form log is still the submit; this is what happened before.

In short: use visits to measure the site and attach it to people you already know. Use the form to collect people who write to you. Do not replace the cookie banner with a consent(true) line pasted under the script: that is tracking without a choice, and it is not what Mokapen publishes.

 

How to open it, and the limits

  • Menu Websites → Website visits (the report) and Tracking (the snippet). Two entries of the same module, not two products.
  • You need the plan that includes tracking (Premium Large, premium-4 gate). Below that plan the two entries show the upgrade: there is no empty report to fill in by hand.
  • The snippet is also in each form’s Settings (same code, same consent). Use it there if you want the path of people who submit that form. For the rest of the site use the Tracking page: one code for the organization, not one per form.
  • Permissions are those of the Websites / Forms module. Anyone who cannot open Websites cannot copy the snippet or read the report.
  • Events stay for about 13 months, then Mokapen removes them. Cookies in the visitor’s browser (mkp_consent and mkp_vid) last 180 days, SameSite Lax, on your site’s domain (not on mokapen.com). It is not a third-party cookie.

 

The snippet: what to copy

On Tracking the first box is only this, with your organization’s slug in place of data-org:

<script src="…/js/tracking.js" data-org="your-org"></script>

Copy it with the button and put it in the header of every page you want to measure (or in Tag Manager, on a tag that fires on those pages). Do not shorten it, do not remove data-org: without that slug the events do not know which organization they belong to.

That script does not call consent. If you publish it alone, the report stays at zero until the banner says yes. That is intentional.

Below it there is a second box, an example, not something to paste into the theme as-is:

mkpTracking.consent(true);
// mkpTracking.consent(false);

The first line goes where the visitor accepts analytics cookies. The second (uncommented) goes on refuse and on “withdraw consent”. On later visits, if the consent cookie is still there, the script starts again by itself: you do not call consent(true) on every page. Call it again only if the banner, on return, loads the page without the script until it re-reads the saved choice.

For an event that is not a page (a download, a button click) there is mkpTracking.trackEvent('name', { }). Same gate: without consent it does not send.

If you previously pasted a version that called consent(true) right under the script, that site still tracks everyone. Replace it with the current snippet and move the yes into the banner.

 

Consent, cookies, notice

  • Mokapen is not the banner. The banner (Cookiebot, Iubenda, yours, the CMS one) stays on the site. Mokapen waits for the call. There is no Mokapen popup to switch on.
  • Two cookies, only after yes.mkp_consent remembers the choice. mkp_vid is the browser identifier. They are not written before yes. With consent(false) Mokapen deletes both and stops sending pages. A second yes creates a new identifier: the previous path does not stitch itself back.
  • What is sent to Mokapen — full page address, referrer, campaign parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content), browser type, visitor identifier. It counts a page load. If the site changes screen without reloading (a single-page app), that screen is not an extra page view.
  • What this module does not do — it does not create the contact, it does not read the site’s address book, it does not replace the form’s privacy text. The form privacy text stays the one in the form editor. For the site, Tracking has the sentence to put in the cookie policy: visit measurement (address, referrer, campaign, browser, 180-day identifier), link to a contact only if that contact already exists, and the option to refuse.
  • Forms hosted by Mokapen — they load the same script, but they do not call consent(true) by themselves. You still need your own consent there, if you want that page counted.

 

Visits report

Websites → Website visits. At the top, the range: 7, 30, 90 or 365 days (default 30). Four numbers:

  • Visitors — distinct browsers (the mkp_vid cookie). The same phone for six months is one visitor, not one per day.
  • Sessions — with this script they match visitors: the cookie lasts 180 days and does not close after half an hour. Do not read it as a classic analytics bounce.
  • Page views — each page load with consent. A screen change without reload does not count.
  • Identified — visitors linked to a contact, with the percentage of visitors. It is the bridge to the CRM, not a vanity traffic number.

Below, the tables:

  • Top pages — the address without the query string, with page views and visitors. Useful to see whether the ads landing page is actually in the traffic, or whether everyone stops on the home page.
  • First touch — source, medium and campaign of the first event of each visit. Without utm you read direct. It is “who brought the person in the first time in the period”.
  • Last touch — the same grid on the last event of the visit. It is “what was in the URL when they came back”, often the link that closed (email, retargeting).
  • Multi-touch — only visitors who were later identified. Each visit weighs 1/N, where N is that browser’s visits in the period. The number is a credit, not a headcount: 2.50 is not three leads.
  • Anonymous visitors — last seen, last URL, first source, sessions and pages. They have no name: that is normal until they submit a form or click an email. It is not a list to export into a call queue.

If everything is empty, the snippet is not on the page, the banner does not call consent(true), data-org belongs to another organization, or you are looking at a period before you published.

 

When a visitor becomes a contact

Three paths, all with consent already given. Without consent there is no cookie to attach.

  • A Mokapen form submit — on the site (embed snippet) or on the form page. If the browser has mkp_vid, Mokapen attaches the pages already seen to that contact and, if the email is new, creates the card the way the form always does. The form creates the contact; tracking does not create it on its own.
  • A click from a Mokapen email — links can carry a token (mkp_et). On the first load with consent, Mokapen looks for a contact with that email. If it exists, visits are attached. If it does not, no “ghost” card is opened.
  • Explicit identify — mkpTracking.identify('email@…') does the same lookup: it links only if the email is already in the address book (Email 1, 2 or 3). Use it if the site login knows the email and the contact exists in Mokapen. Do not use it for “every email typed into a field” before submit: you are watching keystrokes and, if the email is not in the address book, you still do not get a lead.

The contact’s origin stays the form’s (or however you created them). Visits do not rewrite the origin. If the person was already in the address book, the path is updated, the card is not duplicated.

 

Contact card: Website tab

Open the contact and the Website tab. If they never browsed with consent, it is empty: that is not an error.

When there is history you see a score (it stays 0 if you have no scoring rules: it is not the number to read before a call), then sessions and pages, first and last time, first and last source, and the latest pages (up to 30) with URL and date. It is what sales looks at before the call: “they were on pricing three times, last time yesterday, came from Google”. It does not replace the form log or the notes.

The organization report and the contact tab are not the same list. The report is everyone, including anonymous visitors. The tab is only that contact, after the link.

 

Recommended process

  • Write the cookie-policy line first (the sentence is already on Tracking) and agree with legal which banner category is “analytics”. Mokapen does not pick the category for you.
  • Paste only the snippet in the header, so it stays on the page on later visits too. In the banner: accept → consent(true); refuse or withdraw → consent(false). Someone who already accepted is counted on their own, as long as the cookie is there and the script is on the page.
  • Test in a private window: accept, open two pages, check Website visits (7-day range). Then refuse from another browser: that browser must not appear.
  • Submit the contact form in the same session where you accepted. Open the card: Website tab with the earlier pages, origin still the form’s.
  • Only then put utm on the ads. Without utm, first touch is “direct” and you cannot tell which ad brought the visit.
  • Do not leave in production the old copy that called consent(true) by itself.

 

Use cases

The module always measures “pages seen with consent, then attached to a contact if you know them”. What changes is where the snippet sits and when you call consent. Do not use it to collect leads: that is the form.

  • Company site with a cookie banner — The normal case. Snippet in the header, banner already there for the other cookies. In the analytics category (not in “necessary”) call consent(true) only if the person accepts that category. If they accept only the technical cookies, call nothing: Mokapen stays quiet. In the cookie policy paste the sentence from Tracking, not a made-up summary. After a week look at top pages: if the Contact page is missing, the snippet is not on that template.
  • Ads landing pages, same site — You do not make a second snippet. Keep the same script and put different utm on the ad (utm_source=google&utm_medium=cpc&utm_campaign=brand versus linkedin / cpc / b2b). In the report, first touch splits the two campaigns; last touch tells you if they came back from an email. Multi-touch only makes sense after those visitors submit the form: before that they are anonymous and they do not enter that table. Do not clone the form ten times just to “see the campaign”: the campaign is in the URL, the form can stay one.
  • Footer form, the path before submit — The form alone knows the submit. With the snippet on the site, whoever accepts cookies and then writes has the pages they saw before (pricing, cases, about) on the card. If they submit without accepting, the card still exists (the form does not depend on tracking) but the Website tab is empty. Do not block the form waiting for analytics consent: they are two different choices. The form’s privacy consent (newsletter, terms) stays the one in the form editor, not mkpTracking.consent.
  • Click from an email — You already have the contact, because you wrote to them from Mokapen. The link with the token, plus the snippet on the site and consent, attaches the visit to that card without a new form. Use it if you want to see who, among people who received the newsletter, then went to pricing. If the site has no snippet, the click stays an email click: it does not become a page view. If the person refuses cookies, do not push a hidden identify.
  • Private area or login — The site knows the email and the contact is in the address book. After login, and only if they accepted cookies, mkpTracking.identify(email). If the email is not in Mokapen, no contact is born: they have to enter first through a form, an import, or a record you create. Do not call identify on every keystroke of the signup form.

 

Practical examples

1. From the banner to the first number in the report

Websites → Tracking → copy the snippet → theme header (it stays there afterwards, not only for the first yes). In the banner, on the Accept button of the analytics category, add mkpTracking.consent(true). On Refuse, mkpTracking.consent(false). Publish. Open the site in a private window, accept, visit the home page and a landing page. Websites → Website visits → 7 days: at least one visitor and two pages. In the window where you refused you must not see a second visitor. If the number does not move, the script is not on that page or data-org is not the slug you are looking at.

2. Two ads, one form, one report

The snippet is already there. You update the ad URLs with different utm, not the Mokapen code. The contact form stays one (see the form guide): you do not need a hidden field to duplicate the campaign if the utm is already in the URL. After a few submits, Website visits shows first touch by campaign and, for visitors who left an email, multi-touch. On the card, Website tab: the pages before the form. If everyone shows up as direct, the utm never reach the landing page (a redirect strips them, or the click goes through a shortener that drops them).

3. Someone withdraws consent

In the banner, the “edit preferences” link must be able to call consent(false). After that click, reload a page: /track/pageview must not fire, and the cookies mkp_consent and mkp_vid are gone. Pages already stored in Mokapen stay (up to 13 months); they are not deleted by the refusal. What stops is the future. If the person accepts again, they are a new visitor: do not promise in the notice that “the profile is stitched back together”.

 

Frequently asked questions

Q: I copied the snippet and the report is zero.

A: The snippet does not track by itself. You need mkpTracking.consent(true) after acceptance, the right data-org slug, and a report range that includes today. Also check that you are on the plan with tracking.

Q: Can I also paste the consent(true) line under the script, so I start immediately?

A: No. That line is the example to bind to the banner. Putting it in the theme records everyone, including people who did not choose. If you already published it, remove it.

Q: Does tracking create the contact?

A: No. The contact is created by the form, an import, or a manual record. Identify and the email click attach visits only if the email is already there. An anonymous visitor stays anonymous.

Q: Form submitted, Website tab empty.

A: Either they had not accepted cookies before submitting, or the snippet was not on the form page, or the form is on a domain where the cookie is not present (another site, without the script). The form submit is still valid.

Q: Which cookies do I have to declare?

A: mkp_consent and mkp_vid, 180 days, on your domain, only after yes. The ready sentence is in Websites → Tracking, under the example. Do not declare cookies that start before the banner: with the current snippet they do not.

Q: Does a refusal also delete history already in Mokapen?

A: No. It deletes the cookies on that browser and stops later visits. Events already received stay for about 13 months. The contact, if there was one, stays in the address book: refusing analytics is not deleting the card.

Q: What is multi-touch for, if first touch is enough?

A: First touch is the entry campaign. Last touch is the last URL. Multi-touch spreads the credit across the visits of someone who later became a contact, so a person who came from ads and then from email is not entirely attributed to the last click. While they are anonymous, that table does not count them.

Q: Is this the same as the contact form?

A: No. The form collects the fields and creates or updates the card. Visits measure pages. They meet on submit, if there was consent. Form guide: Contact form.

Need help?