Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note

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 Block

Page 2 when petition submitted

Code Block

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 Block

Page 2 when a donation has been made

Code Block