Internal Promotions in GA4 – Rebuilding the Universal Analytics report

The Internal Promotions report in Universal Analytics was one of my favourite Enhanced Ecommerce tracking features. It allowed you to track impressions and clicks for homepage banners, main navigation links or other elements with internal links and then attribute transactions and revenue to those clicks:

The Internal Promotions report in Universal Analytics

Unfortunately, in GA4, this feature was changed fundamentally. Internal Promotions do exist in GA4, but it is now required to send product data with every click and impression.

This requirement means that you can now only track impressions and clicks for promotions for a specific product, which renders the feature useless for general promotions like banners that point to a category page, general discounts, or main navigation links.

If you decide to send impressions and clicks without product data to GA4, then the Internal Promotions report in GA4 looks like this (showing impressions and clicks, but no further actions tied to them):

The Internal Promotions report in GA4 without product data

However, there is a more or less satisfying way to rebuild the original Internal Promotions report from Universal Analytics in GA4. This is what it looks like:

The rebuilt Internal Promotions report in GA4

Let’s go through how to build this, step by step.

Here are the steps that will be required (detailed descriptions of each step below):

  1. Create a custom dimension for the promotion name and two custom metrics for promotion views (aka impressions) and promotion clicks in GA4.
  2. Send events for promotion views and clicks to GA4, using GTM or gtag.
  3. Save the promotion name in a cookie when a promotion click is tracked.
  4. Send the value from the cookie to GA4 with all following ecommerce events.
  5. Create an Exploration in GA4 to show the data.

1. Custom dimension and metrics in GA

We will need a custom dimension for the promotion name and two custom metrics for promotion views and promotion clicks in GA4. Go to Admin > Custom definitions and create a custom dimension with the name “Internal Promo Name”, the scope “Event” and the event parameter “internal_promo_name”:

The custom dimension “Internal Promo Name” in GA4

Next, create two custom metrics with the names “Internal Promo Clicks” and “Internal Promo Views”, the scope “Event”, the event parameters “internal_promo_click” and “internal_promo_view” and the unit of measurement “Standard”:

The custom metrics “Internal Promo Clicks” and “Internal Promo Views” in GA4

2. Sending events for promo views and clicks to GA4

As you are rebuilding the old Universal Analytics Internal Promotions report, you already know when to send promo views and clicks. I am using GTM in this example so I just use the same triggers I have been using for UA.

For the new GA4 tracking, send the following events to GA4:

For promo views

Event name: internal_promo_view
Event parameters:

Parameter NameValue
internal_promo_namedynamic – the name of the viewed promotion
internal_promo_view1

This is what the tag configuration would look like in GTM (if you are using gtag, you can use the same values – documentation here):

Tag configuration for the internal promo view event in GTM

For promo clicks

Event name: internal_promo_click
Event parameters:

Parameter NameValue
internal_promo_namedynamic – the name of the clicked promotion
internal_promo_click1

Again, this is what it would look like in GTM:

Tag configuration for the internal promo click event in GTM

3. Saving the promo name in a cookie

In the last screenshot, you have already noticed that I am using a so-called “Cleanup Tag” that fires right after the promo click event. This tag simply saves the internal promo name in a cookie.

Whenever I need to set cookies in GTM, I refer to this extremely useful article by Julius Fedorovicius: Set Cookies with Google Tag Manager (also read and delete them)

If you are using gtag, you will find a different method to set a cookie with the following parameters:

Cookie name: internalPromoName
Cookie value: dynamic – the name of the clicked promotion
Expiration time: 30 minutes

This is what the tag configuration looks like in GTM:

Tag configuration for saving the internal promo name in a cookie with GTM

4. Sending the promo name with ecommerce events

Now that we have saved the promo name in a cookie, we can send it along as a parameter with all following ecommerce events, including purchases.

In GTM, this can be done very easily with the help of a 1st-Party Cookie variable that pulls the value of the cookie we set in the last step:

1st-Party Cookie variable in GTM

Again, if you are using gtag, you will find a different method to pull the value of our new cookie.

Then, you just add the Event Parameter “internal_promo_name” to all ecommerce events that you send to GA4 and give it the value of the cookie.

This is what the tag configuration of the purchase event would look like in GTM with the new Event Parameter “internal_promo_name” at the bottom:

The tag configuration for the purchase event in GTM

5. Exploration in GA4

Now that we are tracking impressions and clicks and sending the name of the last clicked promotion along with all ecommerce events, including purchases, we can build an Exploration in GA4 to show the data.

In this example, I included the dimension “Internal Promo Name” and the following metrics:

  • Internal Promo Views
  • Internal Promo Clicks
  • Add to carts
  • Checkouts
  • Ecommerce purchases
  • Purchase revenue

I also added a filter that excludes the value “(not set)” for the dimension “Internal Promo Name”.

Here you can see the result again (same screenshot as at the top):

The rebuilt Internal Promotions report in GA4

Final considerations

If your Universal Analytics property is still tracking data and you compare your rebuilt GA4 report with the old report in UA, you will notice that the numbers for impressions and clicks are identical, except for the small variation that you have to expect when you compare data collected by different tracking scripts.

“Add to carts” and “Checkouts” did not exist in the old Universal Analytics report, so they are an added value here.

GA4 does not have calculated metrics (yet?), so the new report does not have equivalents for “Internal Promotion CTR” and “Transactions Per Internal Promotion Click”, but we could calculate them in Looker Studio or in a spreadsheet, if we wanted to.

The revenue attributed to clicks, you will notice, is higher with this method than it was in the old UA report.

I believe this is partly due to the fact that the cookie survives the end of a session and is valid for a total of 30 minutes. I assume that UA only attributes sales to promo clicks that happen within the same session and it is not clear if there is a time limit in UA.

Also, there is no information about how UA deals with consecutive clicks on different promotions, but I would assume that it is simply a last-click model, just like in the approach described here.

If you have time for testing (and if your Universal Analytics property is still tracking data), you can play around with the cookie expiration time (and maybe also test with a session cookie) to see if you can manage to get matching revenue numbers in the old and new reports.

Please just leave a comment on this post if you have any questions or remarks. I’ll be happy to help!

4 responses

  1. Any thought on how to apply the promocode on an item level in the datalayer (and not on a transaction level – event parameter (with purchase event) is by default transaction level )? Because different products in the cart (=purchase) can have different promocodes

    1. Hi Joost! Do you mean internal promotions or coupons?

      Promotions on an item level should work with the standard GA4 feature (although I do not find it very useful): https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm&hl=en#apply_promotions

      Coupons can be applied at the item level or at the transaction level: https://developers.google.com/analytics/devguides/collection/ga4/apply-discount?hl=en&client_type=gtm

      Best regards,

      Eoghan

  2. Robert Strait Avatar
    Robert Strait

    Great article – thanks for sharing. We have a framework like this already set up, so using something similar for Promotion tracking feels familiar.

    Question though about the event parameters: You have internal_promo_view (and click) as parameters with a ‘1’ value for each. What does this give us in GA4? If all visitors send the same ‘1’ value for this parameter, what does its inclusion bring us?

  3. Hi Eoghan,

    Thank you for this article.

    I recently encountered a website that uses UTM parameters to track internal promotions. This is a no no according to Google as it breaks the session counts.

    How can your steps as explained here in this article be adjusted to adapt to these UTM tags and what should the URLs that have these UTM tags on it be changed into?

    I appreciate your help in this matter.

Leave a Reply

Your email address will not be published. Required fields are marked *