Google Marketing: Analytics & DV360

Overview

You can sync Lytics audiences to Google Analytics and Google Display & Video (DV360) in the Google Marketing Platform.

Google Analytics is a web analytics service that is part of the Google Marketing Platform. Connect your Google Analytics account to Lytics to run more targeted marketing campaigns based on how your prospects, customers, and other Lytics audiences engage with your website.

Lytics can pass all public audiences as a Custom Dimension to Google Analytics out-of-the-box. This allows for global filters based on Lytics audiences to be applied to reports, custom views and nearly every aspect of your existing Google Analytics account.

Google DV360 enables marketers to manage their reservation, programmatic, and programmatic guaranteed campaigns across display, video, TV, audio, and other channels, all in one place. The Google DV360 Export in combination with the latest version of the Lytics JavaScript tag can be used to sync Lytics audiences to DV360.

The Google Analytics Measurement Protocol for Google Analytics 4 allows users to augment their automatic collection via gtag, Tag Manager, and Google Analytics for Firebase. Export Lytics event streams or audiences via GA4 Measurement Protocol to tie online to offline behavior, or to send events to Google Analytics that happen outside user-interaction (e.g. offline conversions).

Authorization

Passing Lytics audiences to Google Analytics requires that the Lytics JavaScript tag be installed on your site. Also, keep in mind that any Lytics audience you would like to access in Google Analytics must be API enabled, which Lytics also refers to as "public audiences". This will ensure the JavaScript tag can pass the audience membership to Google Analytics.

If you are new to creating authorizations in Lytics, see the Authorizations documentation for more information.

  1. Select Google Marketing from the list of providers.
  2. Select the method for authorization. Note that different methods may support different job types. Google Marketing supports the following authorization methods:
  3. Enter a Label to identify your authorization.
  4. (Optional) Enter a Description for further context on your authorization.
  5. Complete the configuration steps needed for your authorization. These steps will vary by method.
  6. Click Save Authorization.

Google Sign-In

  1. Click Google Sign-in to initiate the authorization flow.
  2. Log in to the Google account you want to authorize and follow Google's instructions.

GA4 Measurement Protocol API Secret

To authorize with a GA4 Measurement Protocol API Secret you will need an API secret created in Google Analytics. Your GA4 API Secret can be found in the Google Analytics UI under Admin > Data Streams > choose your stream > Measurement Protocol > Create. See the GA4 documentation for more information

  1. In the Label text box, enter a name for the authorization
  2. (optional) In the Description text box, enter a description for this authorization
  3. In the API Secret text box, enter your API Secret credential.

DV360 Delegated Auth

The Google DV360 export workflow does not require an authorization, as authorization is delegated to the Lytics DMP Google Ads account. In order to export to DV360 successfully, you will need to link your DV360 advertiser account with the Lytics DMP account. This is done in Google DV360 via the process described here.

The Google DV360 export workflow requires the DV360 tag sync to be enabled in the Lytics account settings first. This configuration can be found in Vault, under Settings > Javascript tag.

Google Analytics: Setup Custom Dimensions

Lytics has the ability to pass all public audiences as a Custom Dimension to Google Analytics out-of-the-box. This allows for global filters based on Lytics audiences to be applied to reports, custom views and nearly every aspect of your existing Google Analytics account.

Integration Details

  • Implementation Type: Server-side Integration and Client-side Integrations.
  • Implementation Technique: REST API Integration - JavaScript Tag Integration.
  • Frequency: Real-time Integration.
  • Resulting data: Audiences in Google Analytics.

This integration uses the Google Anlytics Universal Analytics API and the Google Analytics GA4 APIs.

  1. Custom dimensions Lytics User ID and Lytics Audiences will be created if they haven't been already been created with user-level scope.

    Note: The authorization must have the Google Analytics Editor role to create Custom Dimensions.

  2. Once this job has completed, this will activate the Lytics JS Tag to send Lytics Audience membership along with the Lytics User ID as a collect event to the Google Analytics tag through the two mapped dimensions above, when users visit your web property that has both Lytics and Google Analytics tags installed.

Configuration

If you are new to creating jobs in Lytics, see the Destinations documentation for more information.

  1. Select Google Marketing from the list of providers.
  2. Select the Google Analytics: Setup Dimensions job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. From the Google Analytics Account input, select the Google Analytics account to use. This menu will be populated with all Google Analytics accounts the authorization has access to.
  7. From the Google Analytics Version input, select whether Google Analytics 4 or Google Universal Analytics is used.
  8. From the Web Property input, select which Google Analytics web property to use. This will be the web property you use for all future Google Analytics data syncs.

    πŸ“˜

    Each web property will need its own Google Authorization and integration configuration.

  1. Select Google Analytics 360 if you have one, which enables you to create up to 200 custom dimensions instead of 20.
  2. From the Lytics Audiences Custom Dimension input, select which custom dimension you would like to pass Lytics audiences to. We'll create one for you labeled "Lytics Audiences" if nothing is selected (recommended).
  3. From the Lytics User ID Custom Dimension input, select which custom dimension to pass Lytics user IDs to. One will be created for you labeled "Lytics User ID" if nothing is selected (recommended).
    If you have custom dimensions available in your Google Analytics account, Lytics recommends leaving these Custom Dimension selections blank. This will result in auto-populated labels: Lytics Audiences and Lytics User ID respectively.
  4. Using the Export Fields configuration Lytics has the ability to pass additional data into Google Analytics. Lytics Support should be consulted prior to configuring this field in order to ensure your account will allow for it.
  5. Click Start Export.

Google Analytics Setup Configuration

Configure Lytics Audiences in GA

The final step is to configure the display of Lytics audiences within your Google Analytics account. For full details on how to leverage custom dimensions across Google Analytics, please consult Google's documentation.

Create Google Analytics Segments from Lytics Data

  1. From your Audience Overview inside of Google Analytics select Add Segment towards the top.
    Google Analytics Overview
  2. Select the red + New Segment button at the top of the list of existing Google segments.
  3. Name your segment in the following window. This is what will appear in your reporting and across your Google Analytics interface.
  4. Under Advanced select Conditions. This allows you to create Google Segments from custom dimensions.
  5. Select the dropdown menu that sets the dimension (often this will default to Ad Content) and from the dropdown menu expand Custom Dimensions and click on the Lytics Audiences dimension.
    Lytics audiences custom dimension
  6. In the text input to the right of contains, type in the ID of your audience. This can be found on the Lytics audience overview next to the full audience name. In the example shown below, mobile_web_visitor would be used as the audience ID. Note: the audiences you use must be API enabled.
    Audience ID
  7. Save your Google segment. You can now activate or deactivate this segment at any time to filter all aspects of your Google Analytics dashboard.
    Google Analytics Filter

Lytics Event Override

By default, this integration will fire a Google Analytics event on each page load. This ensures all audience data is associated with the visitor and received by Google. If you would like to prevent this additional event on page load, Lytics offers a custom override that prevents Google Analytics from sending the initial "pageview" event until Lytics audiences have been set properly each time a visitor views a page.

This is an advanced configuration and should only be used if your Google account has a limit on events sent.

  1. Blocklist the native Google Analytics integration. This is required in order to prevent duplicate events.

  2. Alter the Google Analytics Website Tracking tag. The default Google Analytics Website Tracking tag automatically triggers a "pageview" after it has been loaded. To prevent the additional Lytics event this event call must be removed. To do so, simply remove the following line from the default Google Analytics Website tracking code: ga('send', 'pageview');

  3. Install the following Lytics Google Analytics integration snippet. This code should be located just below your Google Analytics Website Tracking code.

    <script>
        !function(l,a){a.liosetup=a.liosetup||{},a.liosetup.callback=a.liosetup.callback||[],a.liosetup.addEntityLoadedCallback=function(l){if("function"==typeof a.liosetup.callback){var o=[];o.push(a.liosetup.callback),a.liosetup.callback=o}a.lio&&a.lio.loaded?l(a.lio.data):a.liosetup.callback.push(l)}}(document,window);
        !function(e,n){var i=function(e){ga(function(){for(var e=ga.getAll(),i=[],a=0,t=e.length;a<t;a++){var o=e[a].get("trackingId"),g=e[a].get("name");o&&i.push({name:g,id:o})}for(a=0;a<n.lio.integrationsConfig.googleAdsIntegration.length;a++)for(var l=n.lio.integrationsConfig.googleAdsIntegration[a],d=0;d<i.length;d++)if(l.web_property===i[d].id){var g=i[d].name;n.ga(g+".require","displayfeatures"),n.ga(g+".set",l.segments_dimension,n.lio.segmentsString),n.ga(g+".set",l.user_id_dimension,n.lio._uid),ga("send","pageview")}})};n.liosetup&&"function"==typeof n.liosetup.addEntityLoadedCallback?n.liosetup.addEntityLoadedCallback(i):console.warn("unable to add Lytics callback, missing callback handler")}(document,window);
    </script>
    

    Here is a full example denoting the proper load order:

    <html>
        <head>
            <!-- Google Analytics Website Tracking -->
            <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-35220005-2', 'auto');
              // ga('send', 'pageview'); <--- this is the line you will comment out or remove
            </script>
    
            <!-- Lytics Google Analytics Integration -->
            <script>
              !function(l,a){a.liosetup=a.liosetup||{},a.liosetup.callback=a.liosetup.callback||[],a.liosetup.addEntityLoadedCallback=function(l){if("function"==typeof a.liosetup.callback){var o=[];o.push(a.liosetup.callback),a.liosetup.callback=o}a.lio&&a.lio.loaded?l(a.lio.data):a.liosetup.callback.push(l)}}(document,window);
              !function(e,n){var i=function(e){ga(function(){for(var e=ga.getAll(),i=[],a=0,t=e.length;a<t;a++){var o=e[a].get("trackingId"),g=e[a].get("name");o&&i.push({name:g,id:o})}for(a=0;a<n.lio.integrationsConfig.googleAdsIntegration.length;a++)for(var l=n.lio.integrationsConfig.googleAdsIntegration[a],d=0;d<i.length;d++)if(l.web_property===i[d].id){var g=i[d].name;n.ga(g+".require","displayfeatures"),n.ga(g+".set",l.segments_dimension,n.lio.segmentsString),n.ga(g+".set",l.user_id_dimension,n.lio._uid),ga("send","pageview")}})};n.liosetup&&"function"==typeof n.liosetup.addEntityLoadedCallback?n.liosetup.addEntityLoadedCallback(i):console.warn("unable to add Lytics callback, missing callback handler")}(document,window);
            </script>
        </head>
        <body>
        </body>
    </html>
    

Lytics Event Override with Google Tag Manager

For those who are using Google Tag Manager, the steps are slightly different due to how load order and integrations are handled within that tool.

🚧

This integration will not work for those using the built-in Google Analytics tag within Google Tag Manager (shown in the screenshot below). When installing Google Analytics this way, you remove the ability to prevent a "pageview" event from being sent before your Lytics audiences have been passed to Google.

ga-tag-manager

Configure Google Analytics Tag

  1. Select Tags from the menu and click New to create a new tag container.
  2. Click Choose a tag type to begin setup... and select Custom HTML from the list.
    gtm-custom-tag-container
  3. Within this container you will place your Google Analytics tracking tag as instructed in step 2 of the Lytics Event Override section above. Essentially, you will copy and paste the Google Analytics tracking code and then remove the ga('send', 'pageview'); line so that Lytics does not send the pageview data before all data has been set with Google.
    GA Tag Example
  4. Under the Advanced Settings, adjust the Tag Firing Priority to be 10 for this tag. The higher the number, the sooner the script runs.
  5. Click on Triggering to configure when the tag is triggered. This is likely going to be All Pages but is dependent on execution details.
    Tag Firing Priority
  6. Name your tag and click Save.
    Save Tag

Configure Lytics Tag

  1. Select Tags from the menu and click New to create a new tag container.
  2. Click Choose a tag type to begin setup... and select Custom HTML from the list.
    Custom HTML Container
  3. In this tag you will paste the "Lytics Google Analytics Integration" from step 3 of the Lytics Event Override section above.
    Lytics GA Tag
  4. Under the Advanced Settings, adjust the Tag Firing Priority to be 9 for this tag. This ensures Lytics will run after Google Analytics has been initialized.
  5. Click on Triggering to configure when the tag is triggered. This is likely going to be All Pages but is dependent on execution details. This must match the targeting used in the Google Analytics container otherwise your GA tag will not fire.
    Tag Firing Priority
  6. Name your tag and click Save.
    Save Tag

At this point, everything should be configured. Publishing the latest version of your tag manager should result in audiences being passed into your Google Analytics account without sending additional, unnecessary events.

Verifying the Integration

A simple way to test that everything is working properly is to use the Google Analytics Debugger Chrome extension from Google. When activated, all of the data that is being passed to Google will also be output in your Google Developer Console. You will simply need to look for the Lytics audiences list in your event as seen here:

Google Analytics 4 (GA4)

GA4, which was first released into beta in 2019, has replaced Universal Analytics (UA) as the default version for Google Analytics installations. GA4 offers a great deal of flexibility and power over its predecessor. The following document outlines the preferred method for enriching GA4 with an individual's profile information, such as audience membership and Lytics user ID.

There are a variety of robust use cases enabled by this integration, most notably the ability to filter GA4 dashboards by Lytics Audiences as well as distribute those audiences efficiently across the Google ecosystem from GA4 directly. Lastly, web properties are complicated by nature. The following recommended approach aims to focus on ease of installation while also preventing a limitation of the power of GA4. Please note that it is always recommended that you consult with your technical teams or partners before proceeding.

Integration Details

  • Implementation Type: Server-side Integration (optional) and Client-side Integrations.
  • Implementation Technique: JavaScript Tag Integration.
  • Frequency: Real-time Integration
  • Resulting data: Audiences and/or User IDs in Google Analytics.

If leveraging the workflow to configure new Dimensions on your behalf, this integration will use the Google Analytics Universal Analytics API. Alternatively, custom user scoped dimensions can be configured manually. Passing the audience membership data or IDs will leverage the profile request API within our JavaScript tag along with the GA4 set user_properties API.

Step 1: Creating Dimensions

To attribute onsite events such as page views or purchases, you must first define new Custom User Scoped Dimensions to store the set of audiences and/or User ID depending on preference. This can be done through our server-to-server integration, in which we'll create two properties: Lytics User ID (ly_user_id_dim) and Lytics Audiences (ly_segments_dim). Alternatively, because we'll pass the data to Google via JavaScript, you can create whatever dimensions you want by following Google's documentation. If taking the manual approach, just be sure to use the user scope option during creation. For details on our server-to-server integration please view our Google Analytics: Setup Custom Dimensions instructions.
GA4 Dimensions

Step 2: Enabling Lytics Audiences

Once the necessary dimensions exist within your preferred Google Analytics account, you'll need to ensure all audiences you would like to send to GA4 are flagged as API Enabled from the Audience edit area of Lytics. This feature ensures no data is ever shared or passed to another tool without your explicit instructions to do so.

Step 3: Configuring GA4

Finally, leveraging the profile listener feature of our JavaScript tag, we'll get details of the current visitor and pass those along to GA4 via your new dimensions. Since there are a nearly infinite number of ways sites can be configured and constructed, it is always best to consult your technical team on this step. Here we'll outline the most common approach assuming that GA4 tag installation default instructions were followed.

Installing GA4

A typical installation of GA4 is completed by installing a few lines of JavaScript on your site. Typically in the header or footer.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D2LPRHX5G4"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'YOUR-PROPERTY-ID');
</script>

Setting User Properties

This will also need to be modified to include the setting of your custom dimensions as well as optionally altering how the initial pageview event is fired. The following example shows ultimately how we'll be sending data to GA4.

gtag('set', 'user_properties', {
    'ly_segments_dim': 'one,two,three',
    'ly_user_id_dim': 'myid123'
});

Getting Profile Data

To pass the current user's audience information as well as optional user ID, you'll first need to retrieve the profile via our personalization API. Luckily the Lytics tag makes this simple using our entityready listener. The Lytics tag will call the desired function once it has identified the user and accessed their profile. Using the information returned, we'll send the user properties as outlined above.

<script type="text/javascript">
  var myCallbackFunction = function(profile){
      // do something here with the profile
      console.log(profile.data.user.segments);
  }

  jstag.call('entityReady', myCallbackFunction); // register the listener
</script>

Full Example

We'll alter the default listener example to verify we did receive audience membership data and then pass that along to GA4 as our lytics_segments_dim dimensions or whatever you named it during the manual creation process.

<!-- Start Send Lytics Audiences to GA4 -->
<script type="text/javascript">
    var handleGA4UserProperties = function(profile){
        if (window.gtag) {
            // ensure we have segments to send to prevent javascript errors
            if(typeof profile != "undefined" && typeof profile.data != "undefined" && typeof profile.data.user != "undefined" && typeof profile.data.user.segments != "undefined") {
                // send the audience membership to GA4 as a user property
                gtag('set', 'user_properties', {
                    'ly_segments_dim': profile.data.user.segments.join(',')
                });
            };
        } else {
            // log a warning if the profile can't be accessed
            console.warn('unable to set audience membership in GA4');
        }
    }

    jstag.call('entityReady', handleGA4UserProperties); // register the entityReady listener
</script>
<!-- End Send Lytics Audiences to GA4 -->

In this case, we also log a warning to the console when a set of audience memberships are unavailable for debugging purposes. For demonstration purposes, a full HTML example of loading the GA4 tag, Lytics tag, and listener function might look like the following:

<html>
    <head>
        <!-- Global site tag (gtag.js) - Google Analytics -->
        <script async src="https://www.googletagmanager.com/gtag/js?id=G-D2LPRHX5G4"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());

            gtag('config', 'YOUR-GA4-PROPERTY-ID');
        </script>
    </head>
    <body>
        Lytics GA4 Demonstration

        <!-- Start Lytics Tracking Tag Version 3 -->
        <script type="text/javascript">
            !function(){"use strict";var o=window.jstag||(window.jstag={}),r=[];function n(e){o[e]=function(){for(var n=arguments.length,t=new Array(n),i=0;i<n;i++)t[i]=arguments[i];r.push([e,t])}}n("send"),n("mock"),n("identify"),n("pageView"),n("unblock"),n("getid"),n("setid"),n("loadEntity"),n("getEntity"),n("on"),n("once"),n("call"),o.loadScript=function(n,t,i){var e=document.createElement("script");e.async=!0,e.src=n,e.onload=t,e.onerror=i;var o=document.getElementsByTagName("script")[0],r=o&&o.parentNode||document.head||document.body,c=o||r.lastChild;return null!=c?r.insertBefore(e,c):r.appendChild(e),this},o.init=function n(t){return this.config=t,this.loadScript(t.src,function(){if(o.init===n)throw new Error("Load error!");o.init(o.config),function(){for(var n=0;n<r.length;n++){var t=r[n][0],i=r[n][1];o[t].apply(o,i)}r=void 0}()}),this}}();
            // Define config and initialize Lytics tracking tag.
            // - The setup below will disable the automatic sending of Page Analysis Information (to prevent duplicative sends, as this same information will be included in the jstag.pageView() call below, by default)
            jstag.init({
            src: 'https://c.lytics.io/api/tag/YOUR-LYTICS-ACCOUNT-ID/latest.min.js',
            pageAnalysis: {
                dataLayerPull: {
                disabled: true
                }
            }
            });

            // You may need to send a page view, depending on your use-case
            jstag.pageView();
        </script>

        <script type="text/javascript">
            var handleGA4UserProperties = function(profile){
                if (window.gtag) {
                    // ensure we have segments to send to prevent javascript errors
                    if(typeof profile != "undefined" && typeof profile.data != "undefined" && typeof profile.data.user != "undefined" && typeof profile.data.user.segments != "undefined") {
                        // send the audience membership to GA4 as a user property
                        gtag('set', 'user_properties', {
                            'ly_segments_dim': profile.data.user.segments.join(',')
                        });
                    };
                } else {
                    // log a warning if the profile can't be accessed
                    console.warn('unable to set audience membership in GA4');
                }
            }

            jstag.call('entityReady', handleGA4UserProperties); // register the entityReady listener
        </script>
    </body>
</html>

Additional Considerations

At this point, you should successfully pass audience membership to GA4 for each user. Given the flexibility of GA4, there are a variety of configuration options. That said, there are a couple of common points that are worth considering.

  1. The load order of tags is essential. For this to work correctly, you'll want to load tags in this order:
    1. GA4
    2. Lytics Tag
    3. Lytics Listener
  2. It may be desired that the GA4 default pageView tag is delayed until the profile information has been set. This ensures all events are associated with the user but could impact the efficiency of tracking page views. This is only recommended for advanced users with a firm understanding of JavaScript. In this case, you would disable the default page view as described here and then fire it manually following the setting of the user properties in our example.
  3. It may be desired to send an event to GA4 noting when the properties are set. This can be done following the entityready function and the user properties being set. For more information on the various ways to configure events, consult Google's documentation.
  4. When testing your integration, Google supports a debug setting in their tag configuration settings. These settings allow access to a debug view where you can see the events stream in real-time to confirm proper behavior.

Step 4: Add GA4 Audience

The final step of this integration is to follow Google's recommended approach for building an audience inside of GA4 using custom dimensions. When prompted which dimension to use, you'll want to select the ly_segments_dim or whatever custom parameter you created and then match based on the value of your audience or a regex match. When passing the audiences to GA4, Lytics converts them to a string separated by commas as Google does not accept arrays. As such, the dimension value will look similar to audience1,audience2,audience3.
GA4 Audience Creation

Google Analytics: Export Audiences

Once you have Lytics audiences flowing into Google Analytics, you can use those audiences to create groups to target with Google Ads. If you have not completed setting up Custom Dimensions in Google Analytics, please do so before continuing with the steps below.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: Real-time Integration - JavaScript Tag Integration.
  • Frequency: Real-time Integration.
  • Resulting data: Audiences that you can use to target groups within Google Ads.

Add Lytics Core Remarketing Audiences

  1. To create a new remarketing group, start in the Google Analytics Admin section, expand Audience Definitions under the Property column, and select Audiences.ga_audiences
  2. Click on New Audience to get started.
  3. On the Link Configuration step, choose a web property that has your Lytics tracking tag on it, and select the Google Ads account that you want the audience that you are building to show up in.
    app
  4. Click Next Step. You can either add custom audiences that you created in Lytics or add the Lytics Core Remarketing Audiences by importing them from Google's Solutions Gallery.
  5. To import the Lytics Core Remarketing Audiences, select Import Segment and search for Lytics. Select Import for the Lytics Core Remarketing Audiences.
    app

Add Custom Lytics Audiences

In addition to adding the Lytics Core Remarketing Audiences, you can add custom audiences that you have created in Lytics.

  1. On the Define Audience step, instead of selecting Import Segment, select Create New.
    app

  2. From the Audience Builder screen, look for the Advanced category on the right-hand side, and select Conditions.
    ga_ads_advanced

  3. To access the Lytics audiences, expand the first dropdown menu and find Lytics Audiences. This will be listed under the Custom Dimensions section.
    app

  4. When you click on the empty text box, Google Analytics will populate an example list to choose from. Each element on the list will be a combination of different Lytics audiences that Google Analytics has seen attached to individual visitors.

  5. To target a specific Lytics audience, leave the second drop-down box at contains and type in the id of the Lytics audience that you want to match. (The ID is the Slug listed in the UI, when you go to edit an audience). Once you have the ID entered, click out of the box (otherwise Google will select the first line that matches what you entered).
    app
    You can use Lytics audiences along with any other tools in the Audience Builder to create the audience that you want to target.

  6. From there you can see how many people Google has seen matching this audience definition in the last 7 days, indicate how long a person remains a part of this audience, give the audience a name, and, when you're done, click Next Step.

  7. Click the +Add Destinations button to link this audience any connected Ads accounts. When you're done, click Publish.

Note: You must complete the first part of the Google Analytics Setup Custom Dimensions in Lytics and let it run for long enough for Google to collect Lytics audience information from your site visitors before Google will show any matches to Lytics audiences. Depending on your site traffic, this could take hours or days.

app

Any audiences that you create this way become part of the Shared Library in Google Ads allowing you to use them as part of your advertising campaigns.

app

Google DV360: Export Audiences

Combining this export job with the latest version of the Lytics JavaScript Tag allows you to create powerful audiences for targeting in Google DV360.

πŸ“˜

Due to a Google requirement beginning March 1, 2024, the User Consent Confirmed checkbox must be selected for the DV360 Export Audiences workflow to run successfully.

Integration Details

  • Implementation Type: Server-side Integration and Client-side Integrations.
  • Implementation Technique: JavaScript Tag Integration, REST API Integration, Audience Trigger Integration.
  • Frequency: Real-time Integration.
  • Resulting data: A Lytics audience is synced to Google DV360. The name will be equal to the audience slug in Lytics.

The client-side part of this integration uses the Lytics JavaScripttag (Version 3) and Google DV360 cookie sync to sync visitors to your website. Once a user visits a page of your website where the tag is installed and the DV360 plugin is enabled, the following will happen:

  1. The user's browser will send an event to Lytics with the user's cookie ID.
  2. The user's browser will send a request to the DV360 cookie sync endpoint with Lytics' Google Network ID and the user's Lytics cookie ID in base64 encoding.
  3. Google DV360 will map the Lytics cookie ID to a cookie ID in their system.

When an export job is created in Lytics, it will do the following:

  1. Create a list in Google DV360 corresponding to the Lytics audience being exported via the Google DV360 proprietary API. The name of the list will be equal to the Audience slug in Lytics. If a DV360 list with that name already exists, the job will use the pre-existing list.
  2. Scan the Lytics audience for current members.
  3. For every audience member, the job will check its Lytics profile for the dv360_id_ts field, which indicates when the the user was last synced by the client-side cookie sync. If the timestamp does not exist or is older than 90 days, the user will be ignored.
  4. For users with a valid dv360_id_ts field, the job will send the user's Lytics cookie ID to Google DV360. Google DV360 will use the match table in their system from the cookie sync to find the user's DV360 ID and add it to the audience.
  5. The job will listen continually for enter and exit events. Users will be added and removed from the audience in Google DV360 via the process described above as they enter or exit the Lytics audience.

Fields

By default, Lytics exports the following fields to Google Marketing DV360.

Lytics User FieldDescriptionGoogle Marketing FieldType
_uidWeb Cookie Id(current)Google DV360 IDstring

Configuration

Follow these steps to set up and configure an export job for Google Marketing in the Lytics platform. If you are new to creating jobs in Lytics, see the Destinations documentation for more information.

  1. Select Google Marketing from the list of providers.
  2. Select the DV 360 Export Audiences job type from the list.
  3. Enter a Label to identify this job you are creating in Lytics.
  4. (Optional) Enter a Description for further context on your job.
  5. Select the audience to export.
    dv360 configuration
  6. In the Advertiser ID text box, enter your DV360 Advertiser ID.
  7. (optional) From the DV360 List input, select which Google DV360 list to append to. If no list is selected, a new list will be created.
  8. Select the Existing Users checkbox to add users who already exist in the selected Lytics audience.
  9. Select User Consent Confirmed to confirm that you have obtained all necessary consent to export users in this audience to Google DV360. This is a Google requirement beginning March 1, 2024, and if this checkbox is not selected after this date, the job will fail. For more information, see https://www.google.com/about/company/user-consent-policy/"
  10. Click Start Export.

Google Marketing: GA4: Measurement Protocol Event Export

The Google Analytics Measurement Protocol for Google Analytics 4 allows users to augment their automatic collection via gtag, Tag Manager, and Google Analytics for Firebase. Export Lytics event streams via GA4 Measurement Protocol to tie online to offline behavior, or to send events to Google Analytics that happen outside user-interaction (e.g. offline conversions).

Integration Details

  • Implementation Type: Server-side
  • Implementation Technique:
    REST API
    Audience triggers
  • Frequency: Real-time
  • Resulting data: configured Engagement Time Field and Session ID Field values and any configured additional parameters are exported to GA4

When an export is created, events from the selected streams will be exported via HTTP to Google Analytics, starting from the first event ever received on the stream and continuing in chronological order. Thereafter, events will be sent as received in near real time (note that a small processing delay is expected between when events are received by Lytics and when they are triggered for export in this workflow). Events are formatted using the fields and inputs selected in the job configuration. For more information on GA4 Measurement Protocol payload formatting see the GA4 documentation

The configuration options and fields sent as identifiers depend on the GA4 Version selected in step 8 of the configuration options below. The Client ID and Measurement ID fields are required for exports selecting gtag.js, while Firebase App ID and App Instance ID are required for those that select Firebase.

For both versions, additional fields choice can be included in the Export Scalar Fields selector, which will be sent as event parameters, included in the param property of the request

Like the client side sync, Lytics sends two user properties: one with an array of Lytics segments that the user belongs to, and another with the User ID Field selected in the job configuration. The job configuration allows you to select the names of these properties, but by default they are set to ly_segments_dim and ly_user_id_dim, respectively.

Fields

According to the GA4 documentation, engagement_time_msec and session_id parameters are recommended for inclusion on each event sent, in order for events to be included in reports like Realtime. These two fields therefore have dedicated selectors in the job configuration in steps 12 and 14.

Additional parameters of your choice can be included using the Export Scalar Fields input.

The name property in the outgoing payload can be configured using the Event Name Field. If none is selected, the name of the stream will be used.

Configuration

Follow these steps to set up and configure an export job for Google Marketing in the Lytics platform. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.

  1. Select Google Marketing from the list of providers.
  2. Select the export job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Complete the configuration steps for your job.

ga4 event export

  1. From the Data Streams to Export input, select choose data to export, a stream is a single source/type of data (you may choose more than one). If none are selected, all streams are exported.

  2. From the GA4 Version input, select either gtag.js or Firebase

  3. (optional) In the Client ID text box, enter the unique identifier for a client. This is a required field for gtag.js.

  4. (optional) In the Measurement ID text box, enter the measurement ID associated with a stream. This is a required field for gstag.js and can be found in the Google Analytics UI under Admin > Data Streams > choose your stream > Measurement ID.

  5. (optional) In the Firebase App ID text box, enter the Firebase App ID. This is a required field for Firebase and can be found in the Google Analytics UI under Project Settings > General > Your Apps > App ID.

  6. (optional) From the Engagement Time Field input, select the field that contains the user's engagement time in milliseconds.

  7. (optional) From the User ID Field input, select a unique identifier for the user.

  8. (optional) In the User Dimension input, enter the custom dimension in your GA4 account that holds unique IDs from Lytics in your GA4 account. The field selected for User ID Field above will be sent as the value. If none is provided, the default is ly_user_id_dim.

  9. (optional) From the Session ID Field input, select the field that contains the user's session ID.

  10. (optional) From the App Instance ID Field input, select the field that contains the user's app instance ID.

  11. (optional) In the Event Name Field text box, enter the field that contains the event name. If none is provided, the default with be the name of the stream.

  12. (optional) In the Segment Dimension input, enter the custom dimension in your GA4 account that contains Lytics Audiences for users in your GA4 account. If none is provided, the default is ly_segments_dim.

  1. (optional) From the Export Scalar Fields input, select additional user fields to send as event parameters in the payload to Google Analytics.

  2. Click the Start job button to start the job

Google Marketing: GA4: Measurement Protocol Audience Export

The Google Analytics Measurement Protocol for Google Analytics 4 allows users to augment their automatic collection via gtag, Tag Manager, and Google Analytics for Firebase. Export Lytics audiences via GA4 Measurement Protocol to tie online to offline behavior, or to send events to Google Analytics that happen outside user-interaction (e.g. offline conversions).

Integration Details

  • Implementation Type: Server-side
  • Implementation Technique:
    REST API,
    Audience triggers
  • Frequency: Real-time
  • Resulting data: configured Engagement Time Field and Session ID Field values and any configured additional parameters are exported to GA4

When an export is created, users will be exported via HTTP to Google Analytics as they enter or exit the selected audience in real time, starting with enter events for all current members of the audience. Events are formatted using the fields and inputs selected in the job configuration. For more information on GA4 Measurement Protocol payload formatting see the GA4 documentation

The configuration options and fields sent as identifiers depend on the GA4 Version selected in step 8 of the configuration options below. The Client ID and Measurement ID fields are required for exports selecting gtag.js, while Firebase App ID and App Instance ID are required for those that select Firebase.

For both versions, up to 25 additional fields of your choice can be included in the Export Scalar Fields selector, which will be included in the param property of the request

Fields

According to the GA4 documentation, engagement_time_msec and session_id parameters are recommended for inclusion on each event sent, in order for events to be included in reports like Realtime. These two fields therefore have dedicated selectors in the job configuration in steps 12 and 14.

Up to 25 additional parameters of your choice can be included using the Export Scalar Fields input.

The name property in the outgoing payload will be set using the following convention, depending on whether the user is entering or exiting the audience: {enter|exit}_{audience_slug}

Configuration

Follow these steps to set up and configure an export job for Google Marketing in the Lytics platform. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.

  1. Select Google Marketing from the list of providers.
  2. Select the export job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Select the audience to export.
  7. Complete the configuration steps for your job.

ga4 audience export

  1. From the GA4 Version input, select either gtag.js or Firebase

  2. (optional) In the Client ID text box, enter the unique identifier for a client. This is a required field for gtag.js.

  3. (optional) In the Measurement ID text box, enter the measurement ID associated with a stream. This is a required field for gstag.js and can be found in the Google Analytics UI under Admin > Data Streams > choose your stream > Measurement ID.

  4. (optional) In the Firebase App ID text box, enter the Firebase App ID. This is a required field for Firebase and can be found in the Google Analytics UI under Project Settings > General > Your Apps > App ID.

  5. (optional) From the Engagement Time Field input, select the field that contains the user's engagement time in milliseconds.

  6. (optional) From the User ID Field input, select a unique identifier for the user.

  7. (optional) From the Session ID Field input, select the field that contains the user's session ID.

  8. (optional) From the App Instance ID Field input, select the field that contains the user's app instance ID.

  9. (optional) From the Export Scalar Fields input, select additional user fields to send as properties in the payload to Google Analytics. Up to 25 may be selected.

  10. Click the Start job button to start the job