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 ability to track if a discount was applied, how much, and if there was free shipping #7

Closed
EfficiencyJunky opened this issue Dec 10, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@EfficiencyJunky
Copy link
Owner

EfficiencyJunky commented Dec 10, 2020

To do this we need to make the following modifications

GOOGLE ANALYTICS CUSTOM DIMENSIONS / METRICS
Dimensions:

  • Order Discount Status
  • Free Shipping

Metrics:

  • Order Discount Amount

MODIFY CODE IN: 01_ss_rawTransactionPush.html
Needs to push this object to dataLayer

discount = {
	'status': (discountAmount < 0) ? "Discount Applied" : "No Discount",
	'amount': (discountAmount < 0) ? discountAmount / 100 : 0,
	'freeShipping': (shippingTotal == 0) ? "Yes" : "No"
}

GTM DL VARIABLES
DL - EEC Purchase - Discount Status -> discount.status
DL - EEC Purchase - Discount Amount -> discount.amount
DL - EEC Purchase - Free Shipping -> discount.freeShipping

TAG MODIFICATION
Add Custom Dimensions / Metric to Purchase tag

  • Custom Dimensions:
    • Index 4 - Dimension Value: {{DL - EEC Purchase - SS Transaction ID}}
    • Index 8 - Dimension Value: {{DL - EEC Purchase - Discount Status}}
    • Index 9 - Dimension Value: {{DL - EEC Purchase - Free Shipping}}
  • Custom Metrics:
    • Index 2 - Metric Value: {{DL - EEC Purchase - Discount Amount}}
@EfficiencyJunky
Copy link
Owner Author

issue resolved in commit 4b0d1a4

Enhanced Ecommerce for Squarespace automation moved this from In progress to Done Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant