Last active
February 12, 2018 07:52
-
-
Save szepeshazi/e9044825fd5d56bc51870eec22949c75 to your computer and use it in GitHub Desktop.
Adding variables from Dart to Google Tag Manager data layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JsObject dataLayer = context['dataLayer']; | |
dataLayer ??= new JsObject(context['Array']); | |
Map<String, dynamic> productInfo = { | |
'name': '1 month subscription', | |
'price': 21000, | |
'currency': 'HUF' | |
}; | |
dataLayer.callMethod('push', [new JsObject.jsify(productInfo)]); | |
context['dataLayer'] = dataLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment