# Combo Cart Flow Analytic Scripts
This is the outline of what functions get called where and when in combo cart flows. This documentation only includes the functions we call, the documentation about analytics library is not included here.
# Sponsorship
The sponsorship flow applies only to flows where a child is sponsored. The following pages are the main landing pages:
- Find a child aka Children list page. User can add a child to cart. https://lo-test.savethechildren.org/site/SPageNavigator/sponsorship.html
- Read more details about a child aka Child profile page.
{child-id}is a variable unique per child https://lo-test.savethechildren.org/site/SPageNavigator/sponsorship.html#!/child/{child-id}
# Sponsorship page
- View page -
setSponsorshipProductId() - View children -
setChildrenViewedCountAnalytics() - Execute a search -
trackSponsorshipSearchAnalytics() - View child profile -
trackChildProfileClick(),setChildProfilesViewedAnalytics(),setChildSearchParametersAnalytics(), - Child added to cart (list or profile page) -
setChildAddedSponsorshipAnalytics() - View error -
setApiFailure()
# Cart page
- View cart:
updateBasket()which callsfetchCartDetails(), which grabs all products from the Luminate cart, maps categories and sets the counts into a cookie and product details into the local storage. Calls initialte incombo-cart-app.jssetComboCartAnalytics()- sets analytics objectstrackInAnalytics()- triggers analytics submission
- Set gift sponsorship -
setProductAnalytics()updates product ids and types - Add donation or change donation type -
setDonationAndFormAnalytics()updates form & donation details only. Must be both as they live in the same final object, doing for clarity and simplicity, assetFromanalytics method rewrites the data. - Form submit - nothing
# Shipping Page
- View page -
setComboCartAnalytics(),trackInAnalytics() - Form submit - nothing
# Billing Page
- View page -
setComboCartAnalytics(),trackInAnalytics() - How did you hear about us input change -
setHowDidYouHearAnalytics() - Payment type change -
setCurrentPaymentType() - Form submit done via
submitSponsorshipBilling():- Just child in the cart:
submitSponsorshipOnlyBilling()->submitSponsorshipOnlyBillingResponse()- On success:
setConfirmationIdAnalytics(),trackTransactionSuccessAnalytics(),resetAnalyticsData() - On error:
setFormSubmissionErrorAnalytics()
- On success:
- Child & one time donation in the cart
- Child & recurring donation in the cart. On success:
setConfirmationIdAnalytics(),setConfirmationIdAnalytics(),trackTransactionSuccessAnalytics(),
- Just child in the cart:
# Thank you page
trackUserAnalytics()- checks if user is logged in and tracks registration in analytics.
# Gift Catalog / Combo cart
# Category page
- No custom events standard page load picks everything up
# Product page
- Analytics Data Layer JS - sets
product_idas a page param on page load, if one is missing. One could be missing if the user clicked on "Buy Now", which is a form submission & not an image, which is a link. - Add product to ca̦rt:
registerProductId()sets the category mappingsubmissionSuccessAnalytics()- standard form submission, but invokes a custom call rulesecommerce_add_cartrather than using standardform_submit
# Cart
- Same as sponsorship
# Shipping page
- View page -
setComboCartAnalytics(),trackInAnalytics()
# Billing Page
- View page -
setComboCartAnalytics(),trackInAnalytics()- Form submit:
- If nothing but catalog items are present or if a single donation is present: nothing
- If sponsorship is present:
- Form submit:
# Review page
- View page -
setComboCartAnalytics(),trackInAnalytics() - If additional recurring donation is present and/or sponsorship is present
- On success:
setConfirmationIdFromAPIAnalytics()
- On success:
# Thank you page
- (mainly controlled by
combo-cart-order-submit-successcomponent):setConfirmationIdAnalytics()- adds gift catalog confirmation code in store/local storagesetComboCartAnalytics()- sets all the other datasetCombinedConfirmationCodesAnalytics()- writes combined confirmation codes intodigitalDataanalytics objecttrackTransactionSuccessAnalytics()- triggers data submission to analyticsresetAnalyticsData()- resets analytics datatrackUserAnalytics()- tracks user registrationcombo-cart-commit-receipt