Skip to main content
Skip table of contents

Expose transaction details (pageJson)

For developers and advanced users only

In page-builder, it is possible to add a JavaScript object to your page’s HTML that contains various properties of the page, such as donation amount. This can be used in Google Analytics or Tag Manager to create eCommerce transactions.

To enable this, go to where it says Hello YOURNAME in the top navigation, and then Account settings > Account Preferences and, near the bottom of the page, tick the box to “Expose transaction details”. Your page-builder pages will now contain a “pageJson” object that consists of various key value pairs:

amountThe amount of the donation (if made)
appealCodeThe Appeal Code (if applicable)
campaignIdThe master campaign ID
campaignPageIDThe page-builder’s campaign ID, as seen in the URL
clientIdYour organisation’s (subaccount) unique ID
countryThe supporter’s tagged Country value
currencyThe currency of the donation (if made), e.g. USD
donationLogIDThe unique ID of the donation, if made
giftProcessBoolean (true or false) – whether a donation has been made or not
localeThe locale code, e.g. en-US
pageCountThe number of pages in the campaign
pageNameThe internal name of your page-builder campaign
pageNumberThe page number of the campaign
pageTypeThe page type, one of advocacypetition, click2call, datacapture, donation, e-card, e-commerce, event, emailsubscribeform, emailtotarget, membership, peer-to-peerevent, premiumgift, splitpage, staticpage, supporterhub, survey, tweetpage, unsubscribe
paymentTypeThe payment type of a donation if applicable, e.g. VISA
receiptNumberThe receipt number
recurringBoolean (true or false) – whether the donation was recurring or not, if applicable
redirectPresentBoolean (true or false) – whether a redirect is present in the page structure
supporterIDThe unique ID of the supporter, generated after submission
trackingIdThe tracking ID seen in the URL (if applicable)
transactionTypeThe three-letter campaign type of the donation, if made, e.g. FCR
upsellDetails on upsell lightbox include originalAmount (donation amount originally selected by supporter), name (lightbox name), and conversion (single to recurring or recurring upgrade)
transactionIdThe unique ID of the donation, generated after submission

To access any of these variables, just format it like this: pageJson.amount

Example of what pageJson might look like on a petition page

Note that on Page 1 the system does not know who the supporter is, so there is no supporterID or country yet.

Page 1

CODE
var pageJson = {
  "clientId":94,
  "pageCount":2,
  "pageName":"ENCC17 petition",
  "giftProcess":false,
  "campaignId":4757,
  "campaignPageId":6565,
  "pageNumber":1,
  "locale":"en-GB"
};

Page 2 when petition submitted

CODE
var pageJson = {
  "clientId":94,
  "pageCount":2,
  "pageName":"ENCC17 petition",
  "giftProcess":false,
  "campaignId":4757,
  "campaignPageId":6565,
  "supporterId":2259636,
  "country":"GBR",
  "pageNumber":2,
  "locale":"en-GB"
};

Example of pageJson on a donation page

Note that giftProcess is true once the donation has been successfully completed and no donation information is available until the donation is submitted at Page 2.

Page 1

CODE
var pageJson = {
  "pageName":"ENCC17 Donation page",
  "clientId":94,
  "giftProcess":false,
  "pageCount":2,
  "pageNumber":1,
  "campaignId":4789,
  "campaignPageId":6665,
  "locale":"en-GB"
};

Page 2 when a donation has been made

CODE
var pageJson = {
  "pageName":"ENCC17 Donation page",
  "clientId":94,
  "giftProcess":true,
  "donationLogId":550154,
  "pageCount":2,
  "pageNumber":2,
  "amount":3.0, 
  "receiptNumber":0,
  "campaignId":4789,
  "campaignPageId":6665,
  "paymentType":"TEST: VISA"
  "recurring":false,
  "supporterId":2259636,
  "country":"GBR",
  "locale":"en-GB",
  "currency":"GBP",
  "transactionType":"FCS"
};
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.