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

Feature/add google tagmanager connector #4255

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnDelete.Text" xml:space="preserve">
<value>Delete Connection</value>
</data>
<data name="ConnectorName.Text" xml:space="preserve">
<value>Google Tag Manager Core Connector</value>
</data>
<data name="TrackAdministrators.Text" xml:space="preserve">
<value>Track for Administrators:</value>
</data>
<data name="TrackingCodeFormat.ErrorMessage" xml:space="preserve">
<value>Tracking Code Cannot Be Empty</value>
</data>
<data name="GtmID.Text" xml:space="preserve">
<value>Tag Manager ID:</value>
</data>
</root>
16 changes: 16 additions & 0 deletions DNN Platform/Connectors/GoogleTagManager/Connector.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div {
width: 100%;
}

#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div input[type='text'], #connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div textarea, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div input[type='text'] {
width: 65% !important;
}

#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div label, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div label {
width: 25% !important;
}

#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div span, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div span {
font-size:0.75em;
font-style:italic;
}
22 changes: 22 additions & 0 deletions DNN Platform/Connectors/GoogleTagManager/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DNN.Connectors.GoogleTagManager
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Lists constants used across the connector.
/// </summary>
internal class Constants
{
/// <summary>
/// The path to the resource file used for localization.
/// </summary>
public const string LocalResourceFile = "~/DesktopModules/Connectors/GoogleTagManager/App_LocalResources/SharedResources.resx";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7B43D266-D6E1-4496-A9A1-487AFEE0D9C0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DNN.Connectors.GoogleTagManager</RootNamespace>
<AssemblyName>DNN.Connectors.GoogleTagManager</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile>
<LangVersion>7</LangVersion>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<LangVersion>7</LangVersion>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Cloud_Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG;TRACE;CLOUD;CLOUD_DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile>
<LangVersion>7</LangVersion>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Cloud_Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>TRACE;CLOUD;CLOUD_RELEASE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<LangVersion>7</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
<None Include="GoogleTagManagerConnector.dnn" />
<None Include="Module.build" />
<None Include="packages.config" />
<None Include="GoogleTagManager.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj">
<Project>{3cd5f6b8-8360-4862-80b6-f402892db7dd}</Project>
<Name>DotNetNuke.Instrumentation</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.Web\DotNetNuke.Web.csproj">
<Project>{ee1329fe-fd88-4e1a-968c-345e394ef080}</Project>
<Name>DotNetNuke.Web</Name>
</ProjectReference>
<ProjectReference Include="..\..\Library\DotNetNuke.Library.csproj">
<Project>{6b29aded-7b56-4484-bea5-c0e09079535b}</Project>
<Name>DotNetNuke.Library</Name>
</ProjectReference>
<ProjectReference Include="..\..\Providers\FolderProviders\DotNetNuke.Providers.FolderProviders.csproj">
<Project>{b267ce88-dffc-4bd8-9962-319e79c52526}</Project>
<Name>DotNetNuke.Providers.FolderProviders</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="App_LocalResources\SharedResources.resx" />
</ItemGroup>
<ItemGroup>
<Content Include="Connector.css" />
<Content Include="connector.htm" />
<Content Include="Images\GoogleTagManager_32X32_Standard.png" />
<Content Include="License.txt" />
<Content Include="ReleaseNotes.txt" />
<Content Include="Scripts\connector.js" />
</ItemGroup>
<ItemGroup>
<Compile Include="Constants.cs" />
<Compile Include="GoogleTagManagerEngine.cs" />
<Compile Include="GoogleTagManagerController.cs" />
<Compile Include="GoogleTagManagerConnector.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="Module.build" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dnn.GoogleTagManagerConnector", "Dnn.GoogleTagManagerConnector.csproj", "{ADB57FFD-677C-4C30-9723-6EE0A475315B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Cloud_Debug|Any CPU = Cloud_Debug|Any CPU
Cloud_Release|Any CPU = Cloud_Release|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Cloud_Debug|Any CPU.ActiveCfg = Cloud_Debug|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Cloud_Debug|Any CPU.Build.0 = Cloud_Debug|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Cloud_Release|Any CPU.ActiveCfg = Cloud_Release|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Cloud_Release|Any CPU.Build.0 = Cloud_Release|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADB57FFD-677C-4C30-9723-6EE0A475315B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4E92A2BF-8DA9-498C-BB30-4B2AB18CE06A}
EndGlobalSection
EndGlobal
34 changes: 34 additions & 0 deletions DNN Platform/Connectors/GoogleTagManager/GoogleTagManager.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<AnalyticsEngineConfig>
<Engines>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleTagManagerEngine, DNN.Connectors.GoogleTagManager</EngineType>
<ElementId>Head</ElementId>
<InjectTop>False</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','[GTM_ID]');</script>
<!-- End Google Tag Manager -->
]]>
</ScriptTemplate>
</AnalyticsEngine>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleTagManagerEngine, DNN.Connectors.GoogleTagManager</EngineType>
<ElementId>Body</ElementId>
<InjectTop>True</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5SXBKKT"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
]]>
</ScriptTemplate>
</AnalyticsEngine>
</Engines>
</AnalyticsEngineConfig>
Loading