Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D10. Google Analytics #95

Open
2 tasks
SyamBabu-M opened this issue Feb 5, 2025 · 10 comments
Open
2 tasks

D10. Google Analytics #95

SyamBabu-M opened this issue Feb 5, 2025 · 10 comments
Assignees

Comments

@SyamBabu-M
Copy link
Contributor

SyamBabu-M commented Feb 5, 2025

The ability to send events triggered in the Footlight widget to the Google Analytics dashboard of the client. This will work only with the

integration and only if the client has added Google tag (gtag.js) to the webpage with the widget. If needed, the gtag ID should be passed to the widget.

The following events should be sent:

  1. list_events - when the widget calls the calendar/events API. Params: calendar_slug, parent webpage url, query string.
  2. list_share - when a user clicks on the event list share button. Params: calendar_slug, parent webpage url, query string, social media link
  3. event_click - when a user clicks on an event in the list. Params: calendar_slug, parent webpage url, event URI
  4. event_share - when a user clicks on the event details share button. Params: calendar_slug, parent webpage url, event URI, social media link
  5. artist_url - when a user clicks on the artists website link or social media links. Params: calendar_slug, parent webpage url, event URI, artist url including website and social media urls

To test, please use the widget demo website which has the Culture Creates Google Analytics gtag G-1CPH9RTLXF setup on each webpage to receive events.

The Google analytics dashboard is here:
https://analytics.google.com/analytics/web/#/p475345206/reports/intelligenthome

I have invited Suhail, Abhishek and Syam to have access to view the Analytics dashboard, so when the time comes you can check that the events are showing up in the Google Analytics dashboard.

Example call:

gtag('event', 'list_events', {
            calendar_slug: result.calendar_slug,
            parent_url: window.location.href,
            query_string: window.location.search
        });
  • Gregory Saumier-Finch (Estimate: 8)
  • D9 bugfix (Estimate: 2)
@saumier saumier assigned sahalali and unassigned saumier Feb 6, 2025
@saumier
Copy link
Member

saumier commented Feb 6, 2025

@sahalali I am assigning this to you so you can feed it to the team at the right moment in the project timeline.

@troughc Please put on your marketing hat to review the 5 events that I think we should track with Google analytics. Thx.

@troughc
Copy link

troughc commented Feb 9, 2025

Hey @saumier, should we also track when the user clicks on the artist's website URL (not just the social media link)?
Looks good.

@troughc troughc assigned saumier and unassigned troughc Feb 9, 2025
@saumier
Copy link
Member

saumier commented Feb 12, 2025

@troughc Yes. We changed the GA event to artist_url so it should capture both artist's website URL and artist's social media links.

@saumier saumier removed their assignment Feb 12, 2025
@saumier
Copy link
Member

saumier commented Feb 17, 2025

@sahalali Some additional thoughts on this feature:

  1. The events should probably have a namespace, something like a prefix footlight_ so that an event like 'event_click' would become 'footlight_event_click' and not create a confusion with other events on the host website.
  2. If we use the GA instantiated on the parent page, then we are dependent on being compatible with whatever version of the GA library the parent page is using. So the Google Analytics code may need to be instantiated by the widget so we are less dependant. Unless there is another way to check the version of the parent page. Food for thought.

@sahalali sahalali assigned AbhishekPAnil and unassigned sahalali Feb 25, 2025
@AbhishekPAnil
Copy link
Contributor

AbhishekPAnil commented Feb 27, 2025

@troughc @saumier We can retrieve the gtag from the parent website during the div integration :

We can check if the gtag exist using:

if (typeof window.gtag === 'function') {
    console.log('[GA] gtag.js is already loaded on the parent page.');
}

This ensures that the widget doesn’t require an explicit gtag ID to be passed during div integration.

I’m currently exploring whether the same approach works for iFrame integration.

One question I have: If the parent website does not have a gtag ID initialized, should we inject our own Google Analytics script?

@saumier
Copy link
Member

saumier commented Feb 27, 2025

One question I have: If the parent website does not have a gtag ID initialized, should we inject our own Google Analytics script?

@AbhishekPAnil No we should not use our own gtag ID. If there is none on the parent page then we should not send any events. The use story is that the owner of the website wants to use their Google Analytics. We don't want to use a Culture Creates analytics gtag ID because then we would have to declare to the owner of the website that Culture Creates is tracking information on their site which would change their privacy declarations to the visitors of their website.

I added Google Analytics with a gtag created by Culture Creates specifically for the Widget Demo website which Culture Creates owns (even if we made a webpage that looks like the NAC it is still being served by Culture Creates). To test, please use the widget demo website which has the Culture Creates Google Analytics gtag G-1CPH9RTLXF setup on each webpage to receive events.

The Google analytics dashboard is here:
https://analytics.google.com/analytics/web/#/p475345206/reports/intelligenthome

@saumier
Copy link
Member

saumier commented Feb 27, 2025

@troughc See comment above. Does it answer the question you passed on to me after this mornings standup?

@AbhishekPAnil
Copy link
Contributor

@troughc Yes. We changed the GA event to artist_url so it should capture both artist's website URL and artist's social media links.

Do you need both the website url and social media links in the same event at the same time or just the one which the user interacts with ?

@troughc
Copy link

troughc commented Feb 28, 2025

Just the one you click on.

@AbhishekPAnil
Copy link
Contributor

@saumier As discussed , I will wait for you review questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants