Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-7479

Improve purchase dataLayer script on GF donation forms

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Should have Should have
    • None
    • None
    • Analytics, Donate page
    • saturn

      Summary

      The dataLayer event 'purchase' implemented on Gravity Forms is missing some critical variables to improve the tracking. We need to implement new standard variables from Google Analytics 4 E-commerce script to match the needs of the Mixpanel Event Tracking plan. 

      Today the current script is as follows:

      {
          event: "purchase",
          ecommerce: {
              currency: "EUR",
              value: "50.00",
              transaction_id: "pi_3OwVMcFP5m5TKVm41lourH8B",
              items: [
                  {
                      item_id: "1",
                      item_name: "one_time_donation"
                  }
              ]
          }
      } 

       

      Requirements

      Implement the full e-commerce script on confirmation of the donation on Gravity Forms as per the example below:

      Note: We are fixing the placement of the variables in the array, for example the currency variable should be sent above the items array (not inside it). We are also changing the information passed through the item_name variable.

       

      dataLayer.push({
        event: "purchase",
        ecommerce: {
            transaction_id: "pi_3OwVMcFP5m5TKVm41lourH8B",
            affiliation: "Greenpeace",
            value: 50.00, 
            currency: "EUR",
            payment_type: "Credit Card",
            items: [
             {
              item_id: "1", 
              item_name: "Il pianeta è la nostra casa", 
              currency: "EUR",
              item_brand: "Greenpeace",
              item_category: "Regular",
              item_variant: "Monthly",
              price: 50.00,
              quantity: 1
            },
           ]
       },}); 

      Specifications for each variable:

      • item_id:
        • 1 = Products & Services in GF
        • 2 = Subscriptions in GF
      • item_name:
        • Reflect the Gravity Forms name or the Page Title 
      • item_variant:
        • Monthly = 1 per month in Subscriptions in GF
        • Weekly = 1 per week in Subscriptions in GF
        • One-time = Products & Services in GF

      Reflect the Billing Cycle chosen 

      • item_category:
        • Single = Products & Services in GF
        • Recurring = Subscriptions in GF
      • item_brand:
        • Greenpeace (always)
      • payment_type:
        • Reflect the payment type chosen by the user
      • price:
        • Reflect the amount of the donation
      • value
        • Reflect the amount of the donation
      • quantity:
        • 1 (always)
      • currency:
        • Reflect the currency set on the form (eg. EUR)

       

      Pages for testing: 

      https://www-dev.greenpeace.org/international/support/donate-today/ 

      The test mode from Stripe needs to be enabled each month after the sync between Production and Staging. If this is not enabled, please ping jmarubay 

      Resources:

      1. https://www.gravityforms.com/blog/gravity-forms-and-stripe-ultimate-guide/ 
      2. Take a look at the previous ticket for more information on how the current variables are connected to Gravity Forms & Stripe settings: https://jira.greenpeace.org/browse/PLANET-7105 

       

            Unassigned Unassigned
            jmarubay Julia Marubayashi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: