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

Add event tag to gtag for enhanced ecommerce google analytics #186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

likecodingloveproblems
Copy link

@likecodingloveproblems likecodingloveproblems commented Feb 12, 2021

as mentioned in #185 i modify google_analytics_gtag.py to get set event data in gtag.
hopefully be useful

@codecov
Copy link

codecov bot commented Feb 12, 2021

Codecov Report

Merging #186 (92be4c6) into master (896a191) will decrease coverage by 0.39%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
- Coverage   94.25%   93.85%   -0.40%     
==========================================
  Files          29       29              
  Lines        1270     1285      +15     
==========================================
+ Hits         1197     1206       +9     
- Misses         73       79       +6     
Impacted Files Coverage Δ
analytical/templatetags/google_analytics_gtag.py 81.81% <62.50%> (-11.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 896a191...fbe90df. Read the comment docs.

Copy link
Member

@bittner bittner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add at least one test for the new functionality in the related unit test module.

From the test the expected outcome (the resulting JavaScript code) should be clear.

analytical/templatetags/google_analytics_gtag.py Outdated Show resolved Hide resolved
Copy link
Member

@bittner bittner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase your PR and add a test for the business logic you added. Thank you!

Comment on lines +86 to +89
try:
dict(value)
except ValueError:
value = f"'{value}'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like a valid pattern. The try-block shouldn't be use for testing on a data type. And what's code in the except-clause? I think this is an edge case of a "pythonic try-except" where the pattern doesn't fit.

It's not clear at first sight what we're trying to achieve. Maybe an if instanceof(value, dict) would be better here, because it's more explicit for the use case.

@bittner bittner changed the title adding event tag to gtag for enhanced ecommerce google analytics Add event tag to gtag for enhanced ecommerce google analytics Jul 14, 2022
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

Successfully merging this pull request may close these issues.

2 participants