Skip to main content
Testing the implementation
Jonas Østergård Bæk avatar
Written by Jonas Østergård Bæk
Updated over 2 months ago

To ensure that the events are sent and received correctly, you can perform a test.

1. What is a dry_run parameter for?

Enhanced signals support testing a given tag implementation and configuration by allowing you to send events with a dry_run parameter. This will validate that the given configuration exists and is set up correctly, check the format of the event, and return the results of the configured transformations:

In the event of success

If successful, you'll receive a response with a JSON body, similar to the following (per target in your configuration):

[   
{
"success": true, // Indicates if the target action was successful. "config_id": 1234, // Parent Property Config ID.
"message": "Valid payload!", // Brief summary response message. "event_payload": { *full payload* }, // Payload of the source event. "target_config": { // Target configuration details. "target_id": "ga4-mp-gtag-precis-ecomm",
"enabled": true,
"event_name": "precis_ecomm",
"measurement_id": "G-XXXXXXXX",
"api_secret": "**********",
"url": "https://www.google-analytics.com/mp/collect",
"currency": "sek" },
"dry_run": false, // Indicates if the target action was a dry run. "data": null,
"errors": [],
"warnings": []
}
]

In the event of failure

If there are validation errors, you'll receive a validation error response with a JSON body similar to the following:

Bad input: 2 validation errors for GoogleAdsClickConversionEvent identifier_id none is not an allowed value (type=type_error.none.not_allowed) conversion_date_time none is not an allowed value (type=type_error.none.not_allowed)

This enables you to ensure that the format of the events being sent is valid and to inspect how your configured transformations appear before going live.

It's strongly recommended to run a test with a dry_run parameter before going live.

The default value for this parameter is 'false'.

When set to 'true', the mentioned above validation will occur.

To send events with a dry_run parameter, simply add 'dry_run=true/false' to this URL (this is the external endpoint for sending requests to Enhanced signals).

Please refer to the explanation here on how to obtain the config_id.

2. General approach to testing the implementation

Regardless of the required target, there is a general approach to testing the implementation. The two steps explained below should be completed for any type of target before starting with target-specific testing guidelines.

Step 1: Make a test purchase

Preview your implementation, make sure that Dry Run is enabled and then perform a test purchase, ideally in production.

Purchases will not be sent to targets if the dry_run parameter is set to 'true'.

Ensure the dry_run parameter is set to 'true'. Otherwise, the debug response in the Chrome Network tab will not be available.

If using Google Tag Manger, simply enabledry_run by toggling it on in the Enhanced Signals tag.

Step 2. Investigate the test purchase in the Chrome inspector

1. First, open the Chrome inspector. To access the Chrome inspector:

  • Open the Google Chrome browser.

  • Right-click on the page.

  • Click 'Inspect'.

  • Click on the 'Network' tab.

2. Search for the keywords 'config' or 'enhanced' to filter the network requests. You should see two network requests:

  • POST request

  • OPTION request

The OPTION request is just a preflight validation for the hit, while the POST request carries the payload.

3. Check the Response tab: a 'success' message indicates that the payload has been successfully received.

4. Check the Preview tab: a 'valid payload' message in the Preview tab is also a positive indicator.

5. Check the Preview tab: expand target_config to preview the payloads representing the various targets. If you find missing or incorrect values, backtrack and apply the necessary changes.

Did this answer your question?