Google Analytics

Get 100% data in your Google Analytics

If you want to sync the data of a purchase or refund event, and integrate via the developer portal, you can read this manual to send the right information to the Transaction Gateway Unit, so we can update your Google Analytics.

The google Sync Flow

Get the properties from Google Anaylics

📘

Ensure you have your measurement ID (starting with G-XXXXXXXX).

You can retrieve this by logging into your Google Analytics backend.

Go to Admin > Data Streams (under "Property").

Select the data stream you wish to configure, or add a new one.

Copy the measurement ID - you will need this later.

Go to Admin > Data Streams (under "Property")

Go to Admin > Data Streams (under "Property")

Select the data stream you wish to configure, or add a new one

Select the data stream you wish to configure, or add a new one

Copy the measurement ID - you will need this later

Copy the measurement ID - you will need this later

Enter your G-tag + secret. You will find your secret under Data Streams > Measurement Protocol API secrets.

Go to Data Streams > Measurement Protocol API secrets

Go to Data Streams > Measurement Protocol API secrets

Copy the secret value or create one, and enter it in the GMS

Copy the secret value or create one, and enter it in the GMS

Configure service via the GMS

Get the Google Tracking ID (google clientId)

Put in the Head of your website

<!-- THIS IS NOT PRODUCTION CODE - THIS IS FOR DEMO PUPRPOSE ONLY -->
<!-- Google Analytics -->
<script>
    (function (i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r;
        i[r] = i[r] || function () {
            (i[r].q = i[r].q || []).push(arguments)
        }, i[r].l = 1 * new Date();
        a = s.createElement(o),
            m = s.getElementsByTagName(o)[0];
        a.async = 1;
        a.src = g;
        m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

    ga('create', 'UA-19433682-1', 'auto');
    ga('send', 'pageview');

    // Get the ClientID
    ga(function (tracker) {
        let clientId = tracker.get('clientId');
        let fld = document.querySelector('[name=clientId]')
        fld.value = clientId;

        // Use this in the FORM to send to TGU
    });

</script>
<!-- End Google Analytics -->

Use the field in the Body

<div><label>Client ID:</label><input type="text" name="clientId"/></div>

Send the Google clientId to the TGU

curl --request POST \
     --url https://rest.fasterpay.nl/v2/transactions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "serviceId": "SL-####-####",
  "description": "Example description",
  "reference": "12345XXY0123",
  "returnUrl": "https://demo.pay.nl/complete/",
  "exchangeUrl": "https://demo.pay.nl/exchange.php",
  "amount": {
    "value": 10,
    "currency": "EUR"
  },
  "paymentMethod": {
    "id": "10",
    "subId": "4"
  },
  "customer": {
    "firstName": "John",
    "lastName": "Doe",
    "phone": "0031612345678",
    "birthDate": "1999-02-15",
    "gender": "m",
    "email": "[email protected]",
    "ipAddress": "213.126.82.230",
    "trust": 5,
    "reference": "NL87654321"
  },
  "order": {
    "countryCode": "NL",
    "deliveryDate": "2022-12-30",
    "invoiceDate": "2022-12-30",
    "deliveryAddress": {
      "firstName": "John",
      "lastName": "Doe",
      "streetName": "Deliverylane",
      "streetNumber": "70",
      "streetNumberExtension": "A",
      "zipCode": "5678CD",
      "city": "Amsterdam",
      "countryCode": "NL"
    },
    "invoiceAddress": {
      "firstName": "Samanta",
      "lastName": "Doe - Jones",
      "streetName": "Invoicestreet",
      "streetNumber": "2",
      "streetNumberExtension": "B",
      "zipCode": "SW36LQ",
      "city": "London",
      "countryCode": "GB"
    },
    "products": [
      {
        "id": "TEST_01",
        "description": "Caramels sweet roll",
        "type": "article",
        "price": {
          "value": 1,
          "currency": "EUR"
        },
        "quantity": 2,
        "vatCode": "H"
      },
      {
        "id": "TEST_02",
        "description": "Cookie tart sugar",
        "type": "article",
        "price": {
          "value": 3,
          "currency": "EUR"
        },
        "quantity": 1,
        "vatCode": "H"
      },
      {
        "id": "TEST_03",
        "description": "Lollipop chocolate bar",
        "type": "article",
        "price": {
          "value": 1,
          "currency": "EUR"
        },
        "quantity": 5,
        "vatCode": "H"
      }
    ]
  },
  "stats": {
    "info": "Campagne 99",
    "tool": "Google",
    "extra1": "Customer 6985615",
    "extra2": "Invoice 21.3695",
    "extra3": "Shop Amsterdam"
  },
  "transferData": [
    {
      "name": "gaClientId",
      "value": "VALUE OF THE Google clientID"  // Example 1234567.3434343
    }
  ]
}

Check from html to GMS

If it's not there, please check the payload you send in to the TGU.

Explore the conversions in Google Analytics

📘

No data in Google Analytics?,

Schedule a support eMeeting (business+ Plan)